% Please add the following required packages to your document preamble:
% \usepackage[normalem]{ulem}
% \useunder{\uline}{\ul}{}
\begin{table}[]
\begin{tabular}{ll}
'Classes &
Guidelines \\
Political Hate-speech &
\begin{tabular}[c]{@{}l@{}}A tweet or phrase belongs to the
‘‘Political Hate-speech’’ class assuming it holds anyone or more of the following condition: \hline Abuse: If a tweet contains any hate word about a political individual, political party, government or if it targets the followers of a specific political party. For example, “Ap ka baap nawaz bhagora chor h” translated in English as {[}Your father Nawaz is a truant and thief{]}.Some other offensive terms can be “youthia” and “patwari” targeting the supporters of specific political parties.\end{tabular} \\
Neutral &
A tweet or phrase belongs to the ‘‘Neutral” class if it does not hold any of the characteristics described for the Political Hate-speech class, for example, ‘‘Wsa hi acha lgta ha mujha nawaz sharef” translated in English as {[}I just like nawaz sharef{]}. \\
Offensive &
A tweet or phrase that belongs to the ‘‘Political Hate-speech’’ class will further be classified as “Offensive”. If the tweet contains abusive words or symbols promotes hostility, ignites anger, or incites harm to an individual Political entity or a group of people that belong to a political party or that support a political profile. For example, “Bhounktey rahhooooo nawaz chor” translated in English as {[}Keep on barking nawaz thief{]}. \\
Sarcasm/ low-offensive &
\begin{tabular}[c]{@{}l@{}}A tweet or phrase that belongs to the ‘‘Political Hate-speech’’ class will further be classified as “Sarcasm/ low-offensive”. If the tweet mocks and convery contempt against a political individual, political party and supporter of a specific political profile yet doesn’t contain explicit hate words.\\ \\ For example,” Bilkul thek kaha ap nay nawaz Shareef nay boht investment ki h hmare adliya pay” translated in English as {[} You are right, Nawaz shareef has invested a lot on our judiciary system{]}.\end{tabular}
\end{tabular}
\end{table}
- 757,742
- 49
- 4
-
Please let us know which document class you employ. – Mico Jun 14 '22 at 15:48
-
See page breaking - My table doesn't fit; what are my options? - TeX - LaTeX Stack Exchange first and see if it works. – user202729 Jun 14 '22 at 15:53
-
\documentclass[12pt, a4paper]{report} @Mico this is the class – Samia Aziz Jun 14 '22 at 15:56
-
The code posted is messed up and doesn't even compile. Why are you using more tabulars within the tabular? – frabjous Jun 14 '22 at 16:03
2 Answers
The l column type does not allow automatic line breaking. I would like to suggest you (a) get rid of the nested tabular environments and (b) employ a single tabularx environment, with the X column type in use for the second column.
\documentclass[12pt,a4paper]{report}
\usepackage[margin=2.5cm]{geometry} % set page parameters as needed
\usepackage{tabularx} % for tabularx env. and 'X' col. type
\usepackage{booktabs} % for \midrule and \addlinespace macros
\usepackage{ragged2e} % for \RaggedRight macro
\newcolumntype{L}{>{\RaggedRight}X} % suspend full justification in L-type col.
\begin{document}
\begin{table}[htbp]
\begin{tabularx}{\textwidth}{@{} l L @{}} % occupy full width of text block
Classes & Guidelines \
\midrule
Political hate-speech
& A tweet or phrase belongs to the political hate-speech'' class if it satisfies one or more of the following conditions. \\ \addlinespace & Abuse: If a tweet contains any hate word about a political individual, political party, government or if it targets the followers of a specific political party. For example,Ap ka baap nawaz bhagora chor h'' translated in English as [Your father Nawaz is a truant and thief]. Some other offensive terms can be youthia'' andpatwari'' targeting the supporters of specific political parties. \
\addlinespace
Neutral
& A tweet or phrase belongs to the neutral'' class if it does not hold any of the characteristics described for the political hate-speech class, for example,Wsa hi acha lgta ha mujha nawaz sharef'' translated in English as [I just like nawaz sharef]. \
\addlinespace
Offensive
& A tweet or phrase that belongs to the political hate-speech'' class will further be classified asoffensive'' if the tweet contains abusive words or symbols promotes hostility, ignites anger, or incites harm to an individual Political entity or a group of people that belong to a political party or that support a political profile. For example, Bhounktey rahhooooo nawaz chor'' translated in English as [Keep on barking nawaz thief]. \\ \addlinespace Sarcasm\slash low-offensive & A tweet or phrase that belongs to thepolitical hate-speech'' class will further be classified as sarcasm\slash low-offensive''. If the tweet mocks and conveys contempt against a political individual, political party and supporter of a specific political profile yet doesn't contain explicit hate words. \\ \addlinespace & For example,Bilkul thek kaha ap nay nawaz Shareef nay boht investment ki h hmare adliya pay'' translated in English as [You are right, Nawaz shareef has invested a lot in our judiciary system].
\end{tabularx}
\end{table}
\end{document}
- 506,678
-
Just wondering how can i remove "Abuse" as a new row? because it isn't one its part of the text In front of Political hate-speech. When i do remove it the whole table falls apart. – Samia Aziz Jun 14 '22 at 16:34
-
@SamiaAziz - I must confess I didn't understand the code you posted around the "abuse" item. Does it belong in the right-hand column, along with the explanatory sentence(s)? Please clarify. – Mico Jun 14 '22 at 16:47
-
1I apologize for the messed up code. Yes it belongs to right hand column first row. – Samia Aziz Jun 14 '22 at 16:49
-
@SamiaAziz - Then just change
Abuse & If a tweetto& Abuse: If a tweetand rerun LaTeX. – Mico Jun 14 '22 at 16:50 -
1
-
@SamiaAziz - You're most welcome. Please also see the update code and screenshot I just posted. – Mico Jun 14 '22 at 16:57
-
1
With use of tabularray and microtype packages where for the second column is used X[j] column type which allow automatic line breaking and justifying of text:
\documentclass[12pt,a4paper]{report}
\usepackage[margin=2.5cm]{geometry}
\usepackage{microtype}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{ragged2e} % for \RaggedRight macro
\begin{document}
\begin{table}[htbp]
\begin{tblr}{colspec={@{} l X[j] @{}},
row{2-Z}={rowsep=3pt}
}
Classes & Guidelines \
\midrule
Political hate-speech
& A tweet or phrase belongs to the political hate-speech'' class if it satisfies one or more of the following conditions. \\ & Abuse: If a tweet contains any hate word about a political individual, political party, government or if it targets the followers of a specific political party. For example,Ap ka baap nawaz bhagora chor h'' translated in English as [Your father Nawaz is a truant and thief]. Some other offensive terms can be youthia'' andpatwari'' targeting the supporters of specific political parties. \
Neutral
& A tweet or phrase belongs to the neutral'' class if it does not hold any of the characteristics described for the political hate-speech class, for example,Wsa hi acha lgta ha mujha nawaz sharef'' translated in English as [I just like nawaz sharef]. \
Offensive
& A tweet or phrase that belongs to the political hate-speech'' class will further be classified asoffensive'' if the tweet contains abusive words or symbols promotes hostility, ignites anger, or incites harm to an individual Political entity or a group of people that belong to a political party or that support a political profile. For example, Bhounktey rahhooooo nawaz chor'' translated in English as [Keep on barking nawaz thief]. \\ Sarcasm\slash low-offensive & A tweet or phrase that belongs to thepolitical hate-speech'' class will further be classified as sarcasm\slash low-offensive''. If the tweet mocks and conveys contempt against a political individual, political party and supporter of a specific political profile yet doesn't contain explicit hate words. \\ & For example,Bilkul thek kaha ap nay nawaz Shareef nay boht investment ki h hmare adliya pay'' translated in English as [You are right, Nawaz shareef has invested a lot in our judiciary system].
\end{tblr}
\end{table}
\end{document}
- 296,517



