I'am writing my thesis. I want to create a table.
I'm using the tabularx environment
My code:
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabularx}{\textwidth}{*{3}{>{\centering\arraybackslash}X}}
\toprule
\textbf{Aditivo} & {\textbf{Quantidade (g)} \\
\cmidrule{2-3}
& Carga Mineral (\%) \\
& 20 & 30 \\
\midrule
Fibra & 1,266 & 252 \\
GCC & 0,316 & 52 \\
Amido & 0,016 & 25 \\
ASA & 0,002 & 252 \\
Percol & 0,00032 & 25 \\
\bottomrule
\end{tabularx}
\label{tab_formacao_folhas}%
\end{table}%ckquote
But I want merging the text "Quantidade (g)" and "Carga Mineral" in second and third column. With tabularx , I can't use multicolumn.
Best Answer
Please always post complete documents.
The comment about not being able to use
\multicolumn
withtabularx
is wrong as shown in the first table below, buttabularx
is really for adjusting the widths of paragraphs inp
columns. Using it for numeric columns doesn't really produce a good result, it just spaces the table out, making it harder to read, and if you use\centering
the numeric data isn't aligned. I'd use a setting more like the second table where the data aligns on the,