0

I am trying to create a graph in Latex with the given code:

\documentclass[11pt]{article}

\begin{document}

\begin{table}[H] 
  \centering
  \caption{A table showing the raw data.}
  \vspace{0.3cm}
    \begin{tabular}{|c|c|c|c|}
    \multicolumn{1}{l}{\textit{Height, $h$/$\SI{}{cm}$ ($\pm \SI{1.00}{cm}$) }} & \multicolumn{3}{c}{\textit{Horizontal Distance Travelled, $x$/$\SI{}{cm}$ ($\pm \SI{0.100}{cm}$)}} \\
    \hline
          & 1     & 2     & 3 \\
          \hline
    2.40  & 17.9  & 18.5  & 18.3 \\
    3.40  & 24.0  & 24.3  & 25.0 \\
    5.10  & 27.4  & 28.1  & 28.6 \\
    7.10  & 34.8  & 36.0  & 36.4 \\
    9.00  & 38.0  & 38.7  & 39.0 \\
    12.0  & 45.7  & 45.3  & 44.7 \\
    15.0  & 50.5  & 48.4  & 48.4 \\
    18.0  & 55.0  & 57.2  & 57.3 \\
    21.0  & 60.6  & 60.2  & 58.2 \\
    24.0  & 56.9  & 62.4  & 64.0 \\
    25.6  & 62.3  & 63.3  & 64.2 \\
    \hline
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%

\end{document}

But when I compile, the table looks very uneven:

enter image description here

What is causing the table to align itself in this way and how can I fix this issue?

The latex code here has been changed to the code I meant. The other question was a mistake that I would like to delete.

Thanks, Aidanaidan12

  • 2
    you have specified the headings using l columns so they are single line and force the column to be that wide, also never use \scalebox with tables, it forces inconsistent font and rule sizes – David Carlisle Oct 06 '19 at 11:03
  • 1
    Your question would be improved if your output image matched your code, and your code was a complete document that people could run to test answers. – David Carlisle Oct 06 '19 at 11:05
  • Ah yes. Thank you, it has been changed now. – multipledifferentones Oct 06 '19 at 11:13
  • 1
    please edit to remove the [H] as the code posted produces the unrelated error ! LaTeX Error: Unknown float option \H'.` – David Carlisle Oct 06 '19 at 11:15
  • 2
    Could you please explain the difference to your previous question: https://tex.stackexchange.com/q/510844/134144 – leandriis Oct 06 '19 at 11:27
  • Wrong code and many people had replied - wanted to remove that question but was not able to delete so made this one. – multipledifferentones Oct 06 '19 at 11:47
  • 2
    @Aidanaidan12: Isee. However, you can still apply the tips and trick explained in the answers and comments on your previous question to the table in this question as well. (e.g. splitting up column headers into multiple lines...) – leandriis Oct 06 '19 at 12:05

0 Answers0