Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I made 100 of tabulars like this and never had this problem. I want to end the tabular with an \hline, but after that there is a new line with 2 lines. How do I get rid of it?

\begin{table}[H]
\centering
\begin{tabular}{|l|l|l|}
\hline
- & private & onzichtbaar voor de buitenwereld\\
+ & public & zichtbaar voor de buitenwereld \\
\# & protected & zichtbaar voor subklassen\\
$\sim$ & geen naam & zichtbaar voor alles in dezelfde package\\
\hline
\centering
\end{tabular}
\caption{Visibiliteit van toestand en gedrag}
\end{table}
share|improve this question

1 Answer 1

up vote 6 down vote accepted

Remove the second \centering (just before \end{tabular}) it is doing nothing other than causing a blank row.

share|improve this answer
1  
I knew it was going to be a stupid mistake... I didn't know you don't have to close the centering tag. –  Aaron Dec 18 '12 at 13:55
1  
@Aaron: As a rule of thumb, you only have to close something of the form \begin{...}. –  Mohan Dec 18 '12 at 14:15
    
as Mohan said, also if you had done \begin{center} instead of the first \centering you would have needed the closing \end{center} to come after \end{tabular} so environment nesting works out correctly. –  David Carlisle Dec 18 '12 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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