General ⇒ framing and highlighting in tabular environments
framing and highlighting in tabular environments
...
\begin{tabular}[t]{ | r l r l r | }
\hline
a & b & c & d & e \\
\hline
\end{tabular}
...
and gives a box. The problem I'm having is when I want to put spacing between the horizontal line and the data:
\hline
\\[-2.3mm]
a & b & c & d & e \\
\\[-2.3mm]
\hline
This results in the small spaces and doesn't connect the borders. Any suggestions?
Also, is there a way to fill in a background color for certain cells within a table? Any feedback would be extremely helpful and very much appreciated. Thanks!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
framing and highlighting in tabular environments
LaTeX isn't generating the vertical bars where you want them because the row is blank. You could get around this by simply putting four row separators in the rows, but that's even sloppier.
Instead, use a strut (vertical, zero-width rule) and change the row height:
Code: Select all
\documentclass{article}
\begin{document}
\begin{tabular}[t]{|l|l|l|l|l|}
\hline
\rule{0pt}{5mm}%
a & b & c & d & e \\[2mm]
\hline
\end{tabular}
\end{document}