Hello thorsten,
Very sorry for the previous confusing post. I have gone through the manual but still i didnt get the key point.
Now i have elobrated my problem with two tables the first table is facing problem, while the second one is correct but the cell width and height to be increased.
In first table the table elements are aligned bottom, but it should be aligned center. Please help me in this regard. I am herewith attaching the code.
Code: Select all
\documentclass[b5paper,11pt]{book}
\usepackage{fancybox,array,amsmath,ulem}
\usepackage{tikz-inet,pgf}
\usetikzlibrary{matrix}
\begin{document}
\begin{center}
\small
\begin{tikzpicture}
\matrix (magic) [%
matrix of nodes,
text width=6.5mm,
text height=3mm,
text badly centered
]
{%
\sout{0.5} & \sout{0} & \sout{0} & \sout{0} & \sout{0} & \sout{0}\\
\sout{0} & \sout{0} & \sout{0.5} & \sout{1} & \sout{2.0} & \sout{0}\\
1.0 & 1.5 & 1.0 & 3 & 3.5 & \sout{0}\\
1.5 & 2.0 & 1.0 & 3 & 3.5 & \sout{0}\\
2.0 & 2.0 & 2.0 & 3 & 5.0 & \sout{0}\\
4.0 & 4.0 & 4.0 & 4 & 5.0 & \sout{0}\\
};
% striking out lines
\draw[thin,black] (magic-1-6.north) -- (magic-6-6.south);
\draw[thin,black] (magic-1-1.west) -- (magic-1-6.east);
\draw[thin,black] (magic-2-1.west) -- (magic-2-6.east);
% horizontal lines of the table
\foreach \i in {1,2,3,4,5,6}
\draw[thin,black] (magic-\i-1.north west) -- (magic-\i-6.north east);
\draw[thin,black] (magic-6-1.south west) -- (magic-6-6.south east);
% vertical lines of the table
\foreach \j in {1,2,3,4,5,6}
\draw[thin,black] (magic-1-\j.north west) -- (magic-6-\j.south west);
\draw[thin,black] (magic-1-6.north east) -- (magic-6-6.south east);
\end{tikzpicture}
\end{center}
% this is correct but the cell width and height should be increased
\begin{center}
\small
\begin{tikzpicture}
\matrix (magic) [%
matrix of nodes,
text width=4.5mm,
text badly centered
]
{%
\sout{0.5} & \sout{0} & \sout{0} & \sout{0} & \sout{0} & \sout{0}\\
\sout{0} & \sout{0} & \sout{0.5} & \sout{1} & \sout{2.0} & \sout{0}\\
1.0 & 1.5 & 1.0 & 3 & 3.5 & \sout{0}\\
1.5 & 2.0 & 1.0 & 3 & 3.5 & \sout{0}\\
2.0 & 2.0 & 2.0 & 3 & 5.0 & \sout{0}\\
4.0 & 4.0 & 4.0 & 4 & 5.0 & \sout{0}\\
};
% striking out lines
\draw[thin,black] (magic-1-6.north) -- (magic-6-6.south);
\draw[thin,black] (magic-1-1.west) -- (magic-1-6.east);
\draw[thin,black] (magic-2-1.west) -- (magic-2-6.east);
% horizontal lines of the table
\foreach \i in {1,2,3,4,5,6}
\draw[thin,black] (magic-\i-1.north west) -- (magic-\i-6.north east);
\draw[thin,black] (magic-6-1.south west) -- (magic-6-6.south east);
% vertical lines of the table
\foreach \j in {1,2,3,4,5,6}
\draw[thin,black] (magic-1-\j.north west) -- (magic-6-\j.south west);
\draw[thin,black] (magic-1-6.north east) -- (magic-6-6.south east);
\end{tikzpicture}
\end{center}
\end{document}