테이블이 있고 코드는 다음과 같습니다.
\begin{table}[]
\begin{tabular}{cc|cccccc|}
\cline{3-8}
\multicolumn{1}{l}{}
& & \multicolumn{6}{c|}{\textbf{Time-period (t)}}
\\ \cline{3-8}
\multicolumn{1}{l}{}
& \textbf{} & \multicolumn{1}{c|}{\textbf{0}} &
\multicolumn{1}{c|}{\textbf{1}} & \multicolumn{1}{c|}
{\textbf{2}} & \multicolumn{1}{c|}{\textbf{3}}
& \multicolumn{1}{c|}{\textbf{4}} & \textbf{5}
\\ \hline
\multicolumn{1}{|c|}{}
& \textbf{1} & \multicolumn{1}{c|}{{\color[HTML]{32CB00} 3}} &
\multicolumn{1}{c|}{{\color[HTML]{000000} 3}} & \multicolumn{1}{c|}
{{\color[HTML]{000000} 3}} & \multicolumn{1}{c|}{{\color[HTML]
{000000} 3}} & \multicolumn{1}{c|}{{\color[HTML]{FF0000} -3}+
{\color[HTML]{32CB00}3}+3} & {\color[HTML]{000000} 3} \\ \cline{2-
8}
\multicolumn{1}{|c|}{}
& \textbf{2} & \multicolumn{1}{c|}{} &
\multicolumn{1}{c|}{{\color[HTML]{32CB00} 3}} & \multicolumn{1}{c|}
{3} & \multicolumn{1}{c|}{3}
& \multicolumn{1}{c|}{3} & 3
\\ \cline{2-8}
\multicolumn{1}{|c|}{}
& \textbf{3} & \multicolumn{1}{c|}{} &
\multicolumn{1}{c|}{} & \multicolumn{1}{c|}
{{\color[HTML]{32CB00} 3}} & \multicolumn{1}{c|}{3}
& \multicolumn{1}{c|}{3} & 3
\\ \cline{2-8}
\multicolumn{1}{|c|}{\multirow{-4}{*}{{\rotatebox[origin=c]{90}
{\textbf{Sensor node $i \in V$}}}}} & \textbf{4} & \multicolumn{1}
{c|}{} & \multicolumn{1}{c|}{}
& \multicolumn{1}{c|}{} & \multicolumn{1}
{c|}{{\color[HTML]{32CB00} 3}} & \multicolumn{1}{c|}{3}
& 3 \\ \hline
\end{tabular}
\end{table}
첫 번째 열에서는 텍스트가 테이블 밖으로 나옵니다. 이 문제를 어떻게 해결할 수 있나요?
답변1
다음 추가 코드는 다중 행 회전 텍스트 래핑 요구 사항을 충족합니다.
\begin{turn}{90}
{
\tabular{@{}c@{}}
\textbf{Sensor} \\\textbf{node} \\\textbf{$i \in V$}
\endtabular
}
\end{turn}
MWE
\documentclass{article}
\usepackage{array}
\usepackage{multirow}
\usepackage{rotating,booktabs,xcolor}
\begin{document}
\begin{table}[]
\begin{tabular}{cc|cccccc|}
\cline{3-8}
\multicolumn{1}{l}{}
& & \multicolumn{6}{c|}{\textbf{Time-period (t)}}
\\ \cline{3-8}
\multicolumn{1}{l}{}
& \textbf{} & \multicolumn{1}{c|}{\textbf{0}} &
\multicolumn{1}{c|}{\textbf{1}} & \multicolumn{1}{c|}
{\textbf{2}} & \multicolumn{1}{c|}{\textbf{3}}
& \multicolumn{1}{c|}{\textbf{4}} & \textbf{5}
\\ \hline
\multicolumn{1}{|c|}{}
& \textbf{1} & \multicolumn{1}{c|}{{\color[HTML]{32CB00} 3}} &
\multicolumn{1}{c|}{{\color[HTML]{000000} 3}} & \multicolumn{1}{c|}
{{\color[HTML]{000000} 3}} & \multicolumn{1}{c|}{{\color[HTML]
{000000} 3}} & \multicolumn{1}{c|}{{\color[HTML]{FF0000} -3}+
{\color[HTML]{32CB00}3}+3} & {\color[HTML]{000000} 3} \\ \cline{2-
8}
\multicolumn{1}{|c|}{}
& \textbf{2} & \multicolumn{1}{c|}{} &
\multicolumn{1}{c|}{{\color[HTML]{32CB00} 3}} & \multicolumn{1}{c|}
{3} & \multicolumn{1}{c|}{3}
& \multicolumn{1}{c|}{3} & 3
\\ \cline{2-8}
\multicolumn{1}{|c|}{}
& \textbf{3} & \multicolumn{1}{c|}{} &
\multicolumn{1}{c|}{} & \multicolumn{1}{c|}
{{\color[HTML]{32CB00} 3}} & \multicolumn{1}{c|}{3}
& \multicolumn{1}{c|}{3} & 3
\\ \cline{2-8}
\multicolumn{1}{|c|}
{
\multirow{-4}{*}
{
\begin{turn}{90}
{
\tabular{@{}c@{}}
\textbf{Sensor} \\\textbf{node} \\ \textbf{$i \in V$}
\endtabular
}
\end{turn}
}
}
& \textbf{4} & \multicolumn{1}
{c|}{} & \multicolumn{1}{c|}{}
& \multicolumn{1}{c|}{} & \multicolumn{1}
{c|}{{\color[HTML]{32CB00} 3}} & \multicolumn{1}{c|}{3}
& 3 \\ \hline
\end{tabular}
\end{table}
\end{document}