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've this weird problem where the horizontal lines in a table are overflowing. It might be due to one of the many packages, I'm not sure. Is there a way to forcefully fix the table border.

The latex code used to generate the table is this

\begin{table}%[h]
\caption{test} % title of Table
\centering  % used for centering table
\begin{tabular}{|c|c|c|c|c|} \hline
T & t1  & t2  & t3 & t4 \\ \hline
a & 10\%  & 40\% & 70\% & 95\% \\ \hline
b & 20\%  & 50\% & 80\% & 98\% \\ \hline
c & 30\%  & 650\% & 90\% & 99\% \\ \hline
\end{tabular}
\end{table}

Sample image is:

http://i.stack.imgur.com/0VjCB.png

share|improve this question
    
Welcome to TeX.SE. –  Peter Grill Jun 29 '12 at 1:35
    
This might be caused by the same problem Heiko Oberdiek addresses in this answer –  egreg Dec 13 '12 at 8:49

1 Answer 1

You need to use \\ \hline (you were missing a slash prior to the \hline):

enter image description here

Code:

\documentclass{article}
\begin{document}
\begin{table}%[h]

\caption{test} % title of Table 
\centering % used for centering table 
\begin{tabular}{|c|c|c|c|c|} \hline 
T & t1 & t2 & t3 & t4 \\ \hline 
a & 10\% & 40\% & 70\% & 95\% \\ \hline 
b & 20\% & 50\% & 80\% & 98\% \\ \hline 
c & 30\% & 650\% & 90\% & 99\% \\ \hline 
\end{tabular} 
\end{table}
\end{document}
share|improve this answer
    
The \\ is not the problem. Also some of the tables have this problem while others are fine. I don't know why the line is not wrapping properly. The text is small and not overflowing the cell. –  palhello Jun 29 '12 at 1:33
    
@palhello: Ok, the image was not there when I posted my answer based on your original MWE. That is probably an artifact of your viewer. Try viewing in Acrobat. –  Peter Grill Jun 29 '12 at 1:34
    
I don't see any change in code. I'm using other packages and it must be ruining this. Any way to fix this without going into the packages ? I am viewing it in the acrobat viewer. This is really weird. Some tables are perfect while others are imperfect. I'm using pdflatex. –  palhello Jun 29 '12 at 1:37
2  
You need to post a complete compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate package. The code you posted does not show the problem. Also try zooming in and make sure the you still see the problem. –  Peter Grill Jun 29 '12 at 1:42

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.