# Tikz matrix without outer border

I have want to draw square-tile in tikz like the following picture:

I use matrix styles and put thing in.

My code:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{sq} = [rectangle, minimum width=0.7cm, minimum height=0.7cm, text centered, draw=black ]
\tikzstyle{sqvec} = [matrix,draw=black,thick]

\begin{document}
\begin{tikzpicture}
\node [sqvec] (v7) at (2.5,4) {
\node[sq] {}; &\node[sq] {}; &\node[sq] {}; \\
\node[sq] {}; &\node[sq] {}; &\node[sq] {}; \\
};
\end{tikzpicture}
\end{document}

And here is what I got:

I want to get rid of the second outer border and make inner border have equal thickness with outer border.

• \tikzstyle{sqvec} = [matrix,thick], but for more nice result you need to tweek your nodes' settings. Aug 5 '17 at 14:12

for above image the solution given in my comment should be replaced with more sophisticated way:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{matrix}

\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of nodes,
nodes={minimum size=7mm, draw, outer sep=0pt},
nodes in empty cells,
column sep=-\pgflinewidth, row sep=-\pgflinewidth
]
{
&   &   \\
&   &   \\
};
\end{tikzpicture}
\end{document}