6

In this fantastic post of @percusse: https://tex.stackexchange.com/a/67736/159009

I have problems when I write so much words, like this:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}

\usetikzlibrary{matrix}

\begin{document}
\begin{tikzpicture}
\clip node (m) [matrix,matrix of nodes,
fill=black!20,inner sep=0pt,
nodes in empty cells,
nodes={minimum height=1cm,minimum width=2.6cm,anchor=center,outer sep=0,font=\sffamily},
row 1/.style={nodes={fill=black,text=white}},
column 1/.style={nodes={fill=gray,text=white,align=right,text width=2.5cm,text depth=0.5ex}},
column 2/.style={text width=4cm,align=center,every even row/.style={nodes={fill=white}}},
column 3/.style={text width=3cm,align=center,every even row/.style={nodes={fill=white}},},
row 1 column 1/.style={nodes={fill=gray}},
prefix after command={[rounded corners=4mm] (m.north east) rectangle (m.south west)}
] {
    & Enterprise SAN                     & ioDrive \\
    Problems when I writte a lot in this row&
    Problems when I writte a lot in this row, problems problems problems&
     Low Profile PCIe \\
    Interface       & FC-4                               & PCIe x4 \\
    Drive Units     & 150$\times$15 RPM disks            & 2$\times$80gig\\
    Data Protection & Mirroring                          & Mirroring\\
    Power           & 33.372 kWh/yr                      & 114 kWh/yr\\
    SPC-1 I0PS      & 24.998                             & 86.127\\
};
\end{tikzpicture}
\end{document}

Produce this problem (the structure breaks):

enter image description here

How can I solve it?

(I haven't written this in the commentary because is very difficult to explain this in a commentary).

1
  • Welcome to TeX.SX!! Rather than posting code fragments it is better to give a full minimal working example. Currently we have to guess what packages etc you are using and this makes it really hard to help you. A MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. It is difficult to help you without more information.
    – user30471
    Commented Apr 30, 2018 at 12:23

1 Answer 1

7

You can adjust the height of row two by adding the style row 2/.style={nodes={minimum height=2cm}}. I also replaced text depth=0.5ex by inner sep=.35em in column 1.

\documentclass[border=7mm]{standalone}
\usepackage{tikz}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}

\usetikzlibrary{matrix}

\begin{document}
\begin{tikzpicture}
\clip node (m) [matrix,matrix of nodes,
fill=black!20,inner sep=0pt,
nodes in empty cells,
nodes={minimum height=1cm,minimum width=2.6cm,anchor=center,outer sep=0,font=\sffamily},
row 1/.style={nodes={fill=black,text=white}},
row 2/.style={nodes={minimum height=2cm}}, % <-- added to adjust the height of row 2
column 1/.style={nodes={fill=gray,text=white,align=right,text width=2.5cm,inner sep=.35em}},
column 2/.style={text width=4cm,align=center,every even row/.style={nodes={fill=white}}},
column 3/.style={text width=3cm,align=center,every even row/.style={nodes={fill=white}}},
row 1 column 1/.style={nodes={fill=gray}},
deeper/.style={text=red},
prefix after command={[rounded corners=4mm] (m.north east) rectangle (m.south west)}
] {
               & Enterprise SAN                     & ioDrive \\
    Problems when I writte a lot in this row
                    & Problems when I writte a lot in this row, problems problems problems
                                                         & Low Profile PCIe \\
    Interface       & FC-4                               & PCIe x4 \\
    Drive Units     & 150$\times$15 RPM disks            & 2$\times$80gig\\
    Data Protection & Mirroring                          & Mirroring\\
    Power           & 33.372 kWh/yr                      & 114 kWh/yr\\
    SPC-1 I0PS      & 24.998                             & 86.127\\
};
\end{tikzpicture}
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .