Assume a tikzpicture consisting of three nodes with node text.
\documentclass[border=5mm]{standalone}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{calc, shapes, fit, positioning}
\begin{document}
\tikzset{
block/.style = {rectangle, draw, rounded corners, text width=6.0cm,
text depth=1.50cm, text height=0.4cm, line width=0.75pt},
block_half/.style = {block, text width=2.75cm},
}
\begin{tikzpicture}[node distance=1.5cm, auto]
\node [block, anchor=north east] (row0_col1) {
\textbf{Foo Bar}\\
\textit{Baz:} Qux
};
\node [block_half, right=1cm of row0_col1] (row0_col2) {
\textbf{Foo Bar}\\
\textit{Baz:} Qux
};
\node [block_half, right=1cm of row0_col2] (row0_col3) {
\textbf{Foo Bar}\\
\textit{Baz:} Qux
};
\end{tikzpicture}
\end{document}
How can I align the text in each node such that it is vertically centered and horizontally left?
Best Answer
If you don't specify
text height
andtext depth
, that is the default behaviour. To have them all the same height, set aminimum height
.