TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking to add borders to some cells in a table, such that the borders surround the contents and there is a space between each cell. The best image I could find that shows sort of what I want to achieve is this:

enter image description here

This is possible in HTML via the cellspacing setting in tables. How can I achieve the same in LaTeX? I would only want a few of the table cells to have this internal border, not all of them.

The closest I have come is by using fbox, but I couldn't get them to extend all the way to the edges of the table cells.

share|improve this question
have a look at Example of fancy table using TikZ package – cmhughes Apr 13 '13 at 22:33

For simple tables an easy solution is the hhline package, but I think that is not a good solution for complex tables with \multiwrow and \multicolumn cells, as showed in your question.

In this MWE are showed both problems:

enter image description here

\multirow{2}{*}{alfa} & \bfseries beta & \multicolumn{2}{|c||}{\bfseries beta} & \bfseries alfa \\
& beta & alfa & beta & alfa \\
alfa & beta & alfa & beta & alfa \\
alfa & beta & alfa & beta & alfa \\
\rowcolor{green!30} gamma & delta & gamma & delta & gamma \\
share|improve this answer
You can put multirow in the second row: ` & \bfseries beta & \multicolumn{2}{|c||}{\bfseries beta} & \bfseries alfa \\hhline{||~|:=::=::=::=:|} \multirow{-2}{*}{alfa}& beta & alfa & beta & alfa \\ ` so that the text doesn't get clipped. – Harish Kumar Apr 10 '13 at 23:52
@HarishKumar, yes, much better in this way. But the multirow cell still have 3 colors. Too much for my taste! – Fran Apr 11 '13 at 0:36

Your Answer


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.