After read some examples of matrix of nodes, i wrote this MWE:
\documentclass{article}
\usepackage{tikz}\usetikzlibrary{matrix}
\usepackage{booktabs}
\begin{document}
See the Table \ref{fig:cen2}.
\begin{table}[htb!]
\caption{My very very very very very long useless caption}
\label{fig:cen2}
\begin{tikzpicture}
\matrix (m) [matrix of nodes,
nodes in empty cells,
toprule/.style={%
execute at end cell={%
\draw [line cap=rect,#1] (\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn.north west) -- (\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn.north east);%
}
},
bottomrule/.style={%
execute at end cell={%
\draw [line cap=rect,#1] (\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn.south west) -- (\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn.south east);%
}
},
midrule/.style={%
execute at end cell={%
\draw (\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn.south east)--(\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn.south east);%
}
},
%
anchor=base,
row sep = -\pgflinewidth,
column sep = -\pgflinewidth,
%
row 1/.style={nodes={font=\bfseries, align = center}, anchor = south},%toprule = thick
row 2/.style={anchor = south},
row 3/.style={anchor = south},
row 4/.style={anchor = south},
row 5/.style={anchor = south},
%
column 1/.style={nodes={ text width=2.5cm,align=left, font = \small}},
column 2/.style={nodes={ text width=4.0cm,align=left, font = \small}},
column 3/.style={nodes={ text width=4.0cm,align=left, font = \small}},
column 4/.style={nodes={ text width=4.0cm,align=left, font = \small}}%rectangle,draw,
] at (0,0)
%
{%
Variables & Hypothesis 1 & Hypothesis 2 & Hypothesis 3 \\
Territorial unit &
Final destination for receiving waste generated in the municipality &
Final destination for receiving waste generated in the municipality &
Final destination to receive the waste generated in the municipality \\
Index of coverage &
Maintenance of the urban coverage index, with focus on short term &
Maintenance of the urban coverage index, focusing on medium term &
Maintenance of the urban coverage index, with a long-term focus \\
Garbage Collection with Recovery of Recyclable garbage &
Increase in the Recovery of Recyclable garbage index in the short term &
Moderate increase in the recovery of recyclable garbage index with focus on medium term &
Expectation of implementation of long-term selective collection \\
Composting of organic waste &
Adhesion and massive investment in compost disposal final solid organic waste &
Adhesion and moderate investment in composting final disposal of organic solid waste &
Investment in composting organic long-term solid waste \\
};
\draw [-, very thick] (m-1-1.north west) -- (m-1-4.north east);%linha 1
\draw [-, thick] (m-1-4.south east) -- (m-1-1.south west);%linha 2
\draw [-, thin] (m-2-1.south west) -- (m-2-4.south east);%linha 3
\draw [-, thin] (m-3-1.south west) -- (m-3-4.south east);%linha 4
\draw [-, thin] (m-4-1.south west) -- (m-4-4.south east);%linha 5
\draw [-, thick] (m-5-1.south west) -- (m-5-4.south east);%linha 6
%
\draw[->, color = green, ultra thick, dashed] (m-2-2.mid) -- ([yshift = -5mm]m-5-2.south);
\draw[->, color = orange, ultra thick, dashed] (m-2-3.mid) -- ([yshift = -5mm]m-5-3.south);
\draw[->, color = red, ultra thick, dashed] (m-2-4.mid) -- ([yshift = -5mm]m-5-4.south);
%
\node [below, yshift = -5mm] at (m-5-2.south) {\textcolor{green} {\bfseries Scenario 1}};
\node [below, yshift = -5mm] at (m-5-3.south) {\textcolor{orange}{\bfseries Scenario 2}};
\node [below, yshift = -5mm] at (m-5-4.south) {\textcolor{red} {\bfseries Scenario 3}};
\end{tikzpicture}
\end{table}
\end{document}
But the matrix has crooked lines. How to adjust the lines in horizontal?




yshift? – Feb 14 '18 at 18:28yandp, which are not present inVariables. you should redefine nodes size (addtext depth=0.25exfor example) in the first row. similarly effect you have in other cells too (see first column) – Zarko Feb 14 '18 at 18:37