1

So I have the following table:

\begin{tabular}{l | r}\label{tab:cost}
    Budget Item & Cost \\
    \hline{}
    Books & \$825 \\
    Room/Board & \$12,100 \\
    Personal & \$2,265 \\
    Transportation & \$400 \\
    Resident Tutition & \$11,000
\end{tabular}

And the justification for the left hand side of the first line is a bit off as seen in the following image:

Books is not properly aligned

Note the space before the word 'books' in that table. Is there any way to remove that space? I tried forcing a line break after the horizontal line with \\ which fixes the alignment of books, but that adds a bit of vertical space that I'd rather not have.

Books is properly aligned, but there is a bit of whitespace that I'd rather not have

Thnaks in advance, Avi Caspe

PS: if it helps I am using TeXMaker on Windows, installed from the MiKTeX site. I doubt that matters, but it may.

Avi Caspe
  • 111
  • 2
  • 1
    \hline does not take an argument, so don't use \hline{}, but \hline instead. {} together with the line ending inserts a spurious space at the start of the Books cell. – Werner Dec 19 '17 at 04:03

1 Answers1

2

The solution to your problem is very simple.

All you have to do is eliminate the {} after \hline.

Your code then will be

\begin{tabular}{l | r}\label{tab:cost}
    Budget Item & Cost \\ \hline
    Books & \$825 \\
    Room/Board & \$12,100 \\
    Personal & \$2,265 \\
    Transportation & \$400 \\
    Resident Tutition & \$11,000
\end{tabular}

As a result, you will get Table without {} after \hline

Hope it will help you.

Mauramz
  • 1,464