1

I'm trying to figure out how to create a table with the \matrix command.

Almost got it, but not quite:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of nodes,
nodes={draw=black, font={\ttfamily}, align=left, text width=1.5cm},
column sep=0,row sep=0,
column 1/.style={minimum width=2cm},
column 2/.style={minimum width=3cm},
]{
foo & 1 \\
bar & "Wilson"\\
baz & true \\
quux & 8.736e22 \\
};

\end{tikzpicture}
\end{document}

The space between cells is screwed up; how can I fix?

enter image description here

Jason S
  • 2,838

1 Answers1

1

Set the text height for the nodes, currently the nodes are adjusting their height to the box within them.

See also https://tex.stackexchange.com/a/191240/113380