1

How can I add a title to a table using the adjustbox package? Where should I put the $\caption$ parameter, so that it appears on the top?

\begin{adjustbox}{width=\textwidth}
\centering
\begin{tabular}{cc} 
\toprule
\multicolumn{2}{c}{QE}  \\ 
\hline
USP & NC                \\ 
\hline
1   & 2                 \\
3   & 4                 \\ 
\hline
5   & 6                 \\
7   & 8                 \\ 
\hline
9   & 10                \\
11  & 12                \\
\bottomrule
\end{tabular}
\end{adjustbox}
3
  • I'd recommend to not use adjustbox for content containing text, such as a tabular. This will lead to inconsistent font sizes. For tables that are otherwise too wide, I'd use tabularx. Is there a spe ial reason why you want your very narrow table to be as wide as the textwidth?
    – leandriis
    Sep 20, 2019 at 6:34
  • Regarding the caption: \captionof from the caption package enables you to add a caption to non floating environments.
    – leandriis
    Sep 20, 2019 at 6:37
  • All right I'll use your suggestion thanks :)
    – Caterina
    Sep 20, 2019 at 20:00

0

You must log in to answer this question.

Browse other questions tagged .