Monday, 26 August 2013

How to control the multirow table to fit in one column?

How to control the multirow table to fit in one column?

I have a multirow used in twocolumn format. The issue is that when I used
some circled characters, the column of the table widened to invade the
next column.
How can I control the multirow table to fit in one column?

\documentclass[twocolumn]{article}
\usepackage{multirow}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=1pt] (char) {#1};}}
\newcommand{\round}[1]{%
\tikz[baseline=(char.base)]\node[anchor=south west, draw,rectangle,
rounded corners, inner sep=1pt, minimum size=5mm,
text height=2mm](char){\ensuremath{#1}} ;}
\begin{document}
\centering{
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{Team sheet} & Node 3 & Node 7 \\
\hline
\multirow{3}{*}{Time 1}
& Nodes & 12\circled{3}45678 & 123456\circled{7}8\\
& In & \circled{2}\circled{4}\circled{6} & \circled{6}\circled{8} \\
& Out & \circled{3} & \circled{7} \\
\hline
\multirow{3}{*}{Time 2}
& Nodes & 1\circled{2}\circled{3}\circled{4}5\circled{6}78 &
12345\circled{6}\circled{7}\circled{8}\\
& In & \round{1,2,3}\round{3,4,5}\round{3,6,7}& \round{3,6,7}\\
& Out & \round{2,3,4,6} & \round{6,7,8} \\
\hline
\multirow{3}{*}{Time 3}
& Nodes &
\circled{1}\circled{2}\circled{3}\circled{4}\circled{5}\circled{6}\circled
{7}8 & 12345\circled{6}\circled{7}\circled{8}\\
& In & \round{2,3,4,5,6}\round{2,3,4,6}& \round{3,6,7}\\
& Out & \round{1,2,3,4,5,6} & \round{6,7,8} \\
\hline
\end{tabular}
}
\newpage
TeX encountered an unknown command name. You probably misspelled the
name. If this message occurs when a LaTeX command is being processed,
the command is probably in the wrong place---for example, the error
can be produced by an \item command that's not inside a list-making
environment. The error can also be caused by a missing \documentclass
command.
\end{document}

No comments:

Post a Comment