Graphics, Figures & TablesTable produced in the right way?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
marcus89
Posts: 2
Joined: Wed Oct 14, 2020 8:18 pm

Table produced in the right way?

Post by marcus89 »

After reading through tutorials, documentations and posts, I tried to design a table on my own. The final result looks exactly as it should be :-)

However, I am not sure if I did it the right way. In my opinion, the code looks quite confusing.

So my question, is there a better/more elegant way to design this table?

The table: https://ibb.co/PcsFhRj

Code: Select all

\documentclass[acmsmall]{acmart}
\usepackage{float}
\usepackage{multirow} 
\usepackage{rotating} 
\usepackage{verbatim} 
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}

\begin{table}
  \caption{Table}

  \begin{tabularx}{\textwidth}{llXcccccc}
  \toprule
   {} & {} & {} & \multicolumn{5}{c}{Implic. QA} & {\multirow{2}{*}{\rotatebox[origin=r, y=5pt]{90}{Dtaa Lnq.}}}  \\
    \cmidrule(lllll){4-8}
     Source & NBame & Description & \rotatebox{90}{Accin.} & \rotatebox{90}{Lomp.} & \rotatebox{90}{Ronsi.} & \rotatebox{90}{Volti.} & \rotatebox{90}{Curre.} &  \\ \addlinespace
   
    \midrule
    
     \multirow{4}{*}{\shortstack[l]{Hugo \\ et al.}} & \multirow{4}{*}{Brasilia} & The organization, The organization The organization, The organization, The organization, The organization, The organization, The organization. & \multirow{4}{*}{-}  & \multirow{4}{*}{-} & \multirow{4}{*}{x} & \multirow{4}{*}{-} & \multirow{4}{*}{-} & \multirow{4}{*}{-} \\ \addlinespace
     
     \multirow{3}{*}{\shortstack[l]{Manuel \\et al.}} & \multirow{3}{*}{Nort Carolina} & Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image & \multirow{3}{*}{-}  & \multirow{3}{*}{x} & \multirow{3}{*}{x} & \multirow{3}{*}{-} & \multirow{3}{*}{-} & \multirow{3}{*}{-} \\ \addlinespace
    
     \multirow{2}{*}{\shortstack[l]{Otto \\ et al.}} & \multirow{2}{*}{Manchester} & Image Image Image Image Image Image Image Image & \multirow{2}{*}{-}  & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} \\ \addlinespace%[20pt]
     
     \multirow{2}{*}{\shortstack[l]{Marx \\\& Weak}} & \multirow{2}{*}{France} & Image Image Image Image Image Image Image Image & \multirow{2}{*}{x}  & \multirow{2}{*}{x} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{x} & \multirow{2}{*}{x} \\ \addlinespace
     
     \multirow{2}{*}{\shortstack[l]{Oliver \\\& Wolfor}} & \multirow{2}{*}{Germany} & Image Image Image Image Image Image Image Image & \multirow{2}{*}{-}  & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{x} & \multirow{2}{*}{-} & \multirow{2}{*}{x} \\ \addlinespace
    
     \multirow{3}{*}{\shortstack[l]{Humbold \\et al.}} & \multirow{3}{*}{Hunbary} & Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image & \multirow{3}{*}{-}  & \multirow{3}{*}{-} & \multirow{3}{*}{-} & \multirow{3}{*}{x} & \multirow{3}{*}{-} & \multirow{3}{*}{-} \\ 
    
  \bottomrule
  \end{tabularx}
\end{table}

\end{document}


Please ignore the content of the table.

Thank you very much and best regards, Marcus

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Table produced in the right way?

Post by Bartman »

Your image can be viewed independently of a file hosting service, if you upload it to the forum's server.
table-rows-vertical-centered.jpg
table-rows-vertical-centered.jpg (46.65 KiB) Viewed 2040 times
My adjustment to the first few lines of your table should show the remarkable changes I would like to propose.

Code: Select all

\documentclass[acmsmall]{acmart}
\usepackage{multirow} 
\usepackage{rotating} 
\usepackage{tabularx}
\usepackage{booktabs}
     
\newcommand{\ctab}[1]{%
    \begin{tabular}{@{}l@{}}#1\end{tabular}%
}
     
\begin{document}
\begin{table}
    \caption{Table}
    \renewcommand{\tabularxcolumn}[1]{m{#1}}
    \begin{tabularx}{\textwidth}{llX*6c}
    \toprule
    & & & \multicolumn{5}{c}{Implic. QA} & 
    \multirow{2}{*}{\rotatebox[origin=r, y=5pt]{90}{Dtaa Lnq.}}\\
    \cmidrule(lr){4-8}
    Source & NBame & Description & 
    \rotatebox{90}{Accin.} & \rotatebox{90}{Lomp.} & \rotatebox{90}{Ronsi.} & 
    \rotatebox{90}{Volti.} & \rotatebox{90}{Curre.} & \\
    \midrule
    \ctab{Hugo\\et al.} & Brasilia & The organization, The organization The organization, 
    The organization, The organization, The organization, The organization, 
    The organization. & -- & -- & $\times$ & -- & -- & -- \\ 
    \addlinespace
    \ctab{Manuel\\et al.} & Nort Carolina & Image Image Image Image Image Image Image 
    Image Image Image Image Image Image Image Image & 
    -- & $\times$ & $\times$ & -- & -- & -- \\
    \bottomrule
    \end{tabularx}
\end{table}
\end{document}
If you want to use \cite commands in the cells of the first column, then it would be better to replace the column type l with m{<width>} instead of inserting a table in the cells.
marcus89
Posts: 2
Joined: Wed Oct 14, 2020 8:18 pm

Table produced in the right way?

Post by marcus89 »

thank you very much for your hints :-)
Post Reply