Generalproblem with layout of tabular environment

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
dimarcom
Posts: 26
Joined: Wed Mar 05, 2008 11:03 am

problem with layout of tabular environment

Post by dimarcom »

Dear texers,

The lines sticking out of the table for the first 2 columns are quite ugly... can you help me removing them ? here's the code:

\documentclass{article}
\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{|c|ccc|p{3cm}p{2.5cm}|} \\ \hline
1 & Rc1/4 & customer & machine & spindle coolant water OUT & water drain \\
2 & Rc1/4 & customer & machine & spindle coolant water IN & \\
\end{tabular}
\end{table}
\end{document}

thanks,
marie.
Attachments
lines of tabular sticking out !?
lines of tabular sticking out !?
table.JPG (8.98 KiB) Viewed 2410 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: problem with layout of tabular environment

Post by balf »

Replace the first line of your tabular environment with:
\begin{tabular}{|c|ccc|p{3cm}p{2.5cm}|} \hline

Now I have to say that the vertical lines shouldn't be used. See the doc of the booktabs package.

B.A.
Attachments
booktabs.pdf
(189.24 KiB) Downloaded 224 times
dimarcom
Posts: 26
Joined: Wed Mar 05, 2008 11:03 am

Re: problem with layout of tabular environment

Post by dimarcom »

Hi Balf,

Thanks for the tip about the vertical lines sticking out of my tables. It's been a while since you posted it, but better now than never !

I had a look at booktabs.pdf, it looks quite interesting ! I'll try to use it. Although "never using vertical lines" sounds exagerate, maybe in an ideal typesetting world you don't need vertical lines, but they do help sometimes.

thanks
marie
Post Reply