There is no option to do that. But: there are good news. You can disable the separator lines between the 'sub-nodes' (with the option rectangle split draw splits=false
- as you see it takes a boolean argument) and manually draw the separators, as you wish. This is possible since the anchors for the end-points of the separator lines are still available and freely accessible. All you need to do is name your node. (Here I gave it the very original examplenode
name.):
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node[name=examplenode, rectangle split, rectangle split draw splits=false, draw] {1 \nodepart{two} 2 \nodepart{three} 3 \nodepart{four} 4};
\draw[dashed] (examplenode.text split west) -- (examplenode.text split east);
\draw[dashed] (examplenode.two split west) -- (examplenode.two split east);
\draw[dashed] (examplenode.three split west) -- (examplenode.three split east);
\end{tikzpicture}
\end{document}
EDIT: In case of horizontal split rectangles the names of the anchors are not 'translated'. In this case a small hack, involving the use of the calc
library for TikZ
is necessary:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{calc,positioning}
\begin{document}
\begin{tikzpicture}
\node[name=examplenode, rectangle split, rectangle split horizontal, rectangle split draw splits=false, draw] {1 \nodepart{two} 2 \nodepart{three} 3 \nodepart{four} 4};
\draw[dashed] ($(examplenode.north)!0.5!(examplenode.north west)$) -- ($(examplenode.south)!0.5!(examplenode.south west)$);
\draw[dashed] (examplenode.north) -- (examplenode.south);
\draw[dashed] ($(examplenode.north)!0.5!(examplenode.north east)$) -- ($(examplenode.south)!0.5!(examplenode.south east)$);
\end{tikzpicture}
\end{document}
Here, the corners of the rectangle are still named the same way and so are the centers of the top and bottom lines. By taking the middle of the top and bottom line (examplenode.north
, examplenode.south
) you can draw the centerline. the other two lines are used by finding the middle of the segments between corner and middle of top/bottom line. (This latter code can be adapted to position the lines separating the subnodes in different places e.g. when the subnodes are not identical in size.) Below a more generalized code, using \foreach
loops to draw the separator lines.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{calc,positioning}
\begin{document}
\begin{tikzpicture}
\node[name=examplenode, rectangle split, rectangle split horizontal, rectangle split draw splits=false, draw] {1 \nodepart{two} 2 \nodepart{three} 3 \nodepart{four} 4};
\foreach \subnode in {1,...,3}% counter goes 1 to number_of_subnodes-1
{\draw[dashed] ($(examplenode.north east)!{\subnode*0.25}!(examplenode.north west)$) -- ($(examplenode.south east)!{\subnode*0.25}!(examplenode.south west)$);}
\end{tikzpicture}
\end{document}
If you substitute in the above code the anchors (change the line in the \foreach
loop to:
{\draw[dashed] ($(examplenode.north east)!{\subnode*0.25}!(examplenode.south east)$) -- ($(examplenode.north west)!{\subnode*0.25}!(examplenode.south west)$);}
, you will have the vertical node split properly.