0

I put this code in LaTeX:

\begin{table}[H]

\begin{tabularx}{\linewidth}{l*{4}{>{\centering\arraybackslash}X}}

\toprule

Ensaio & Medi\c{c}\~{o}es do comprimento do fio (cm) & Incerteza associada (cm)\\

\midrule

1 & 48,80 & 0,05\\

2 & 48,80\\

3 & 48,70\\

M\'{e}dia & 48,77\\

\bottomrule

\end{tabularx}

\end{table}

I wanna the numbers and the text of first column in the center. How I make this?

  • 5
    You've posted some questions already, you should know how to mark the code up by now. Also most of your questions have acceptable answers, but unfortunately, you did not accept a single one. This is not how TeX.SX works. Accepting and upvoting means appreciating the work done by many users here – user31729 Apr 11 '16 at 22:10
  • 1
    you have declared a 5 column table but no row has more than 3 columns, it is hard to guess the intended layout. Also no one can run your fragment to see the issue, please always make your examples complete documents. – David Carlisle Apr 11 '16 at 22:13
  • 2
    use c not l for a centred column. – David Carlisle Apr 11 '16 at 22:14
4

I would do it this way. Note you can use accented letters from your keyboard, as all systems nowadays understand UTF8:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
 \usepackage{amsmath,tabularx, float, booktabs}
 \renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}

\begin{document}

\begin{table}[H]
  \begin{tabularx}{\linewidth}{c*{2}{X}}
    \toprule
    Ensaio & Medições do comprimento do fio (cm) & Incerteza associada (cm) \\
    \midrule
    1 & 48,80 & 0,05 \\
    2 & 48,80\\
    3 & 48,70\\
    Média & 48,77\\
    \bottomrule
  \end{tabularx}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.