# How to achieve double border line between some columns of tikz matrix?

I've read TikZ matrix as a replacement for tabular which nicely explained how to get table with borders in the first place.

Now, I'd like to have let's say thicker border (or double border line) between 2 & 3 columns of my multicolumn matrix. As far as I understand column sep is specified for entire matrix. So is it possible to mimic at least appearance of different border between some columns?

I want this to visually show on example how data was normalized in DB and I want to separate superkey from other columns.

-
add comment

## 1 Answer

You can customise the distance between columns when you're writing the first row of your matrix. For example

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\begin{tikzpicture}
\matrix [matrix of nodes,row sep=-\pgflinewidth,nodes={rectangle,draw,minimum width=3em}]
{
0   &[-\pgflinewidth]   3 &[5mm]    6 \\
1   &                   1 &         3 \\
2   &                   2 &         9 \\
};
\end{tikzpicture}

\end{document}


gets you this:

Note that I have used the answer from the question linked in this question as a template, but I've kept it simple to highlight the column separations.

-
This works! However I don't see default column sep besides row sep that you have. I guess it is necessary if there are many columns and one is lazy to explicitly specify separation after each ampersand sign. What I wonder is that when I add supposedly default column sep that it affects visually the distance between columns. Do they add up (default & after & sign) or something? –  mlt Feb 8 '12 at 17:53
The effect seems to be additive. –  qubyte Feb 8 '12 at 18:24
add comment