多行多列表

时间:2011-06-01 17:43:33

标签: latex

我需要在LaTeX中创建下表,我似乎无法正确使用它。

Image

单元格内的文本未正确居中,“眼睛运动”单元格也是如此。你们中的任何人都能看到我做错了吗?

\begin{tabular}{ccc|c}
& & \multicolumn{2}{c}{\textbf{Response}} \\ 
& & unnatural & natural \\ \cline{3-4}
\multicolumn{1}{c}{\multirow{2}{*}{\begin{sideways}\textbf{Eye movement}\end{sideways}}} &
\multicolumn{1}{c|}{\begin{sideways}unnatural\end{sideways}} & 1 & \multicolumn{1}{c|}{2} \\ \cline{2-4}
\multicolumn{1}{c}{}                        &
\multicolumn{1}{c|}{\begin{sideways}natural\end{sideways}} & 3 & \multicolumn{1}{c|}{4}   \\ \cline{3-4}
\end{tabular}

2 个答案:

答案 0 :(得分:2)

感谢指针。我终于使用以下代码:

\begin{table}[h]\centering
\def \BoxWidth {3.5cm}
\def \BoxHeight {2cm}
\def \SWidth {0.2cm}
\newcolumntype{M}{>{\centering\arraybackslash}m{\BoxWidth}}
\newcolumntype{S}{>{\centering\arraybackslash}m{\SWidth}}
\newcolumntype{R}{>{\raggedright\arraybackslash}m{\BoxWidth}}
\begin{tabular}{SSM|M}
~ & ~ & \multicolumn{2}{c}{\textbf{Response}} \\ 
~ & ~ & unnatural & natural  \\  \cline{3-4}
\multirow{2}{*}{\begin{sideways}{\textbf{Eye Movements}}\end{sideways}} 
~ & \begin{sideways}\parbox{\BoxHeight}{\centering unnatural}\end{sideways} 
&  \multicolumn{1}{|R|}{Command-based interfaces} &  \multicolumn{1}{R|}{Not Possible} \\ \cline{2-4}
~ & \begin{sideways}\parbox{\BoxHeight}{\centering natural}\end{sideways} 
& \multicolumn{1}{|R|}{Non-command interfaces} &  \multicolumn{1}{R|}{Virtual environments} \\  \cline{3-4}
\end{tabular}
\end{table}

答案 1 :(得分:1)

Wikibooks documentation on LaTeX非常好,你应该看看some of the numerous examples for different table formats。其中一些只需稍微修改即可重现您的图像。