[Tex/LaTex] midrule and toprule in table too long

booktabstables

I am having trouble with reducing the horizontal lines in following table.
I'm using a custom layout that was given to me and it looks like it reduces the standard page width. The horizontal lines I have added to my table are too long as a result. I've seen various answers here usingĀ \begin{tabular*}{@{} .... @{}} for example, but none work for me and I feel there should be a simpler way.

I have attached my code and a screenshot and would be very grateful for help.

P.S If someone knows how to reduce the horizontal space between two word clouds in the same row, please also let me know. Thanks

\begin{figure}
\begin{tabular}{m{0.10\textwidth}m{0.45\textwidth}m{0.45\textwidth}}
\centering
\textbf{Aspect}  & \ \ \multicolumn{1}{c}{\textbf{Negative Reviews}}  & \ \ \multicolumn{1}{c}{\textbf{Positive Reviews}}  \\
\toprule
Look & {\includegraphics[scale=0.2]{figures/wordle/look_bad_crop}} & {\includegraphics[scale=0.21]{figures/wordle/look_good_crop}} \\
\midrule
Smell & {\includegraphics[scale=0.2]{figures/wordle/smell_bad_crop}} & {\includegraphics[scale=0.2]{figures/wordle/smell_good_crop}} \\
\midrule
Feel & {\includegraphics[scale=0.2]{figures/wordle/feel_bad_crop}} & {\includegraphics[scale=0.2]{figures/wordle/feel_good_crop}} \\
\end{tabular}
\caption{Word-cloud visualisation for each of the three aspect. MAP subsets were extracted for each review from the training, validation and test set. Word size reflects frequency in these MAP sets.}
\label{fig:wordle}
\end{figure}

enter image description here

Best Answer

You shouldn't use the m type just for vertically centering the images.

\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{booktabs}

\begin{document}

\begin{table}
\centering

\begin{tabular}{@{} l c c @{}}
\textbf{Aspect}  & \textbf{Negative Reviews} & \textbf{Positive Reviews} \\
\midrule
Look
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\midrule
Smell
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
Feel
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

enter image description here

You get a table as wide as the text block with tabular*:

\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{booktabs}

\begin{document}

\begin{table}
\centering

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l c c @{}}
\textbf{Aspect}  & \textbf{Negative Reviews} & \textbf{Positive Reviews} \\
\midrule
Look
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\midrule
Smell
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
Feel
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\bottomrule
\end{tabular*}

\end{table}

\end{document}

enter image description here

Related Question