1

In my latex document, I am trying to create a table like this;

\begin{document}    
\begin{table}[H]
  \caption[Features for Classifications]{\small Features for Classifications}
  \begin{center}
  \resizebox{\textwidth}{!}{
    \begin{tabular}{c|c|c}
      \hline \textbf{Type} &  & \textbf{Features} \\ 
      \hline
        \begin{tabular}[c]{@{}l@{}}Context \\Based \\Features \end{tabular}
        &\begin{tabular}[c]{@{}l@{}}F1 \\F2\\ F3\\ F4\\ F5\\ F6\\ F7\\ F8\end{tabular} 
        &\begin{tabular}[c]{@{}l@{}}
            Total number of citations received by a reference \\ Number of citations from the     current paper to the cited paper\\ Citations in introduction section\\ Citations in literature review section\\ Citations in method section\\ Citations in experiment section\\ Citations in discussion section\\ Citations in conclusion section
          \end{tabular} \\ 
          \hline
     \begin{tabular}[c]{@{}l@{}}Cue \\ Words \\Based \\Features \end{tabular} 
      & \begin{tabular}[c]{@{}c@{}}F9 \\ F10\\ F11\\F12\end{tabular}
      & \begin{tabular}[l]{@{}l@{}}Cue words for Related work citations       \\ Cue words for Comparative citations\\ Cue words for Using the existing work\\ Cue words for Extending the existing work\end{tabular} \\ \hline
      \begin{tabular}[c]{@{}l@{}}Textual \\Features \end{tabular} & \begin{tabular}    [c]{@{}l@{}}F13 \\ F14\\\\\end{tabular} & \begin{tabular}[c]{@{}l@{}}Similarity between the abstract of cited paper and text of citing paper\\ Author overlap -we set it to TRUE if the cited paper and citing paper\\ share at least one common author\end{tabular}  \\\hline
    \end{tabular}}
  \end{center}
  \label{tab: 1}
\end{table} 
\end{document}    

It results out something like this;

Table Result

How can I left align 1st and 3rd row last column text?? I am new to latex, so any kind of help will be appreciated.

3
  • 1
    Apart from the alignment issue you describe, please consider not using resizebox in order to make a table fit into the available space since this approach inevitably leads to inconsistent font sizeas and line thicknesses.
    – leandriis
    Commented Feb 14, 2021 at 13:02
  • What does "left align 1st and 3rd row last column text" refer to? Do you refer to the different horizontal liagnment of the "Cue words for..." lines in the last column as compared to the other rows in the last column?
    – leandriis
    Commented Feb 14, 2021 at 13:03
  • I am referring to Features column text Commented Feb 14, 2021 at 13:07

2 Answers 2

1

Here are two suggestions:

enter image description here

\documentclass{article}
%%% Used in both examples:
\usepackage{booktabs}
\usepackage{caption}
\captionsetup[table]{font=small}

%%% Used only in the first example:
\usepackage{makecell}
\usepackage{multirow}
\usepackage{tabularx}
\begin{document}

\begin{table}
  \caption[Features for Classifications]{Features for Classifications}  
  \label{tab: 1}
  \centering
    \begin{tabularx}{\textwidth}{ccX}
      \toprule
      \textbf{Type} &  & \textbf{Features} \\ 
      \midrule
      \multirow{9}{*}{\makecell{Context\\ Based\\ Features}}
            & F1 & Total number of citations received by a reference \\ 
            & F2 & Number of citations from the current paper to the cited paper\\
            & F3 &  Citations in introduction section\\ 
            & F4 & Citations in literature review section\\ 
            & F5 & Citations in method section\\ 
            & F6 & Citations in experiment section\\ 
            & F7 & Citations in discussion section\\ 
            & F8 & Citations in conclusion section \\
       \midrule
       \multirow{4}{*}{\makecell{Cue\\ Words\\ Based\\ Features}}
          & F9 & Cue words for Related work citations \\ 
          & F10 & Cue words for Comparative citations\\ 
          & F11 & Cue words for Using the existing work\\ 
          & F12 & Cue words for Extending the existing work \\
       \midrule 
       \multirow{5}{*}{\makecell{Textual\\ Features}}
          & F13 & Similarity between the abstract of cited paper and text of citing paper\\ 
          & F14 & Author overlap -we set it to TRUE if the cited paper and citing paper\\ 
          & F15 & share at least one common author \\
       \bottomrule
    \end{tabularx}
\end{table} 

 
\begin{table}
  \caption[Features for Classifications]{Features for Classifications}
  \label{tab: 1}
  \centering
    \begin{tabular}{@{\quad}l@{\enspace}l@{}}
      \toprule
      \multicolumn{2}{@{}l}{Context Based Features}\\
      \midrule
            F1 & Total number of citations received by a reference \\ 
            F2 & Number of citations from the current paper to the cited paper\\
            F3 &  Citations in introduction section\\ 
            F4 & Citations in literature review section\\ 
            F5 & Citations in method section\\ 
            F6 & Citations in experiment section\\ 
            F7 & Citations in discussion section\\ 
            F8 & Citations in conclusion section \\
      \midrule
      \multicolumn{2}{@{}l}{Cue Words Based Features}\\
      \midrule
          F9 & Cue words for Related work citations \\ 
          F10 & Cue words for Comparative citations\\ 
          F11 & Cue words for Using the existing work\\ 
          F12 & Cue words for Extending the existing work \\ 
      \midrule
      \multicolumn{2}{@{}l}{Textual Features}\\
      \midrule
          F13 & Similarity between the abstract of cited paper and text of citing paper\\ 
          F14 & Author overlap -we set it to TRUE if the cited paper and citing paper\\ 
          F15 & share at least one common author \\
      \bottomrule
    \end{tabular}
\end{table} 
\end{document}    
1
  • first approach worked like a charm. Thank you :) Commented Feb 14, 2021 at 13:42
1

A variant with tabularx and the \multirowcell command (from makecell) in the first column. I also added an \extrarowheight to have a table looking less tight, and replaced the centerenvironment, which adds spurious vertical spacing, with the \centering command:

\documentclass{article}
\usepackage{float}
\usepackage{caption, tabularx, multirow, makecell}

\begin{document}

\begin{table}[H]
\renewcommand{\cellalign}{lc}\small
\setlength{\extrarowheight}{2pt}
\centering

  \caption[Features for Classifications]{\small Features for Classifications}
  \label{tab: 1}
    \begin{tabularx}{\textwidth}{c|c|X}
      \hline \textbf{Type} & & \textbf{Features} \\
      \hline
    \multirowcell{8}{Context \\ Based \\Features} & F1 & Total number of citations received by a reference \\
    & F2 & Number of citations from the current paper to the cited paper\\
    & F3 & Citations in introduction section\\
    & F4 & Citations in literature review section\\
    & F5 & Citations in method section\\
    & F6 & Citations in experiment section\\
    & F7 & Citations in discussion section\\
    & F8 & Citations in conclusion section \\
    \hline
    \multirowcell{4}{Cue \\ Words \\Based \\Features} & F9 & Cue words for Related work citations \\
    & F10 & Cue words for Comparative citations\\
    & F11 & Cue words for Using the existing work \\
    & F12 & Cue words for Extending the existing work \\
    \hline
    \multirowcell{4}{Textual \\Features} & F13 & Similarity between the abstract of cited paper and text of citing paper \\
    & F14 & Author overlap – we set it to TRUE if the cited paper and citing paper share at least one common author \\ \hline
 \end{tabularx}
\end{table}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .