0

I made a table in my thesis with this code:

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabularx}{\hsize}{cc}
    \toprule
    & Folhosas \\
    \midrule
    Celulose & 5 \\
    Hemicelulose & 2 \\
    Extrac & 6 \\
    Lenhinha & 9 \\
    \bottomrule
    \end{tabularx}
  \label{tab:addlabel}
\end{table}

But, I want the text in the middle of table. Can you help me?

2

1 Answer 1

2

enter image description here

\documentclass{article}    
\usepackage{tabularx,booktabs}

\begin{document}
\begin{table}[htbp]
  \centering
  \caption{Add caption}\label{tab:addlabel}
    \begin{tabularx}{\textwidth}{*{2}{>{\centering\arraybackslash}X}}
    \toprule
    & Folhosas \\
    \midrule
    Celulose & 5 \\
    Hemicelulose & 2 \\
    Extrac & 6 \\
    Lenhinha & 9 \\
    \bottomrule
    \end{tabularx}
\end{table}
\end{document}

Alternatively you may want to take a look on the package tabulary and its C column.

You must log in to answer this question.

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