I've tried to apply the answer in Minimum height in split rectangle (with many thanks to Alain Matthes) using their defined mystrut
.
I modified their code to have two lines in each nodepart
in the section of their code after % Split Rectangle
, when I add \centerline{......} \centerline{........}
after \nodepart{one} \mystrut
, it will only modify the height of the box around the first line instead of the entire \nodepart{one}
, how can I fix it?.
The modified code:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\def\mystrut{\vrule height 1.5cm depth 1.5cm width 0pt}
\begin{document}
\begin{tikzpicture}[auto,
rect/.style={
rectangle split,
rectangle split parts=4,
draw=black,
rounded corners,
text width = 3cm
}]
% Split Rectangle
\node [rect] {
\mystrut \centerline{First} \\ \centerline{Item}
\nodepart{two}\mystrut \centerline{Second} \\ \centerline{Item}
\nodepart{three} \centerline{$\vdots$}
\nodepart{four} \mystrut \centerline{Last} \\ \centerline{Item}
};
\end{tikzpicture}
\end{document}
Result: