答案1
这是一个使用环境的解决方案tabular*
。它还省去了所有垂直线和几乎所有的水平线。在模板有全宽水平线的某些地方,我插入了垂直空白作为视觉分隔线。请记住,“负空间”在提供视觉分隔线方面与水平线和垂直线一样强大。
\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{array,multirow,ragged2e,booktabs}
\begin{document}
\begin{table}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\textwidth}{ @{\extracolsep{\fill}} *{8}{l} }
\toprule
Index & Types & Name & Albedo &
Brightness & Particle & Emission & Rendering \\
\midrule
0 & --- & Eeny \\
\addlinespace
1 & \multirow{4}{*}{Type 1} & Meeny\\
2 & & Miny\\
3 & & Moe \\
4 & & Catch\\
\addlinespace
5 & \multirow{4}{*}{Type 2} & A \\
6 & & Tiger\\
7 & & By \\
8 & & His\\
\addlinespace
9 & \multirow{6}{*}{Type 3} & Toe \\
10& & If He \\
11& & Hollers \\
12& & Let \\
13& & Him \\
14& & Go\\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
答案2
您正在寻找的包裹是multirow
。
\documentclass{article}
\usepackage[margin=0.8in]{geometry}
\usepackage{multirow}
\begin{document}
\begin{table}[htb]
\centering
\begin{tabular}{p{0.092\textwidth}*7{|p{0.092\textwidth}}}
\hline
Index & Types & Names & Albedo & Brightness & Particle & Emission & Rendering\\
\hline
0 & & & & & & & \\
\hline
\hline
1 & \multirow{4}{*}{Type 1} & & & & & & \\
\cline{1-1} \cline{3-8}
2 & & & & & & & \\
\cline{1-1} \cline{3-8}
3 & & & & & & & \\
\cline{1-1} \cline{3-8}
4 & & & & & & & \\
\hline
\hline
5 & \multirow{4}{*}{Type 2} & & & & & & \\
\cline{1-1} \cline{3-8}
6 & & & & & & & \\
\cline{1-1} \cline{3-8}
7 & & & & & & & \\
\cline{1-1} \cline{3-8}
8 & & & & & & & \\
\hline
\hline
9 & \multirow{6}{*}{Type 3} & & & & & & \\
\cline{1-1} \cline{3-8}
10 & & & & & & & \\
\cline{1-1} \cline{3-8}
11 & & & & & & & \\
\cline{1-1} \cline{3-8}
12 & & & & & & & \\
\cline{1-1} \cline{3-8}
13 & & & & & & & \\
\cline{1-1} \cline{3-8}
14 & & & & & & & \\
\hline
\end{tabular}
\end{table}
\end{document}
请注意,现在的趋势是减少分隔线,您可以自动对行进行编号。tabularx
在这里使用它可能也很有用。
\documentclass{article}
\usepackage[margin=0.8in]{geometry}
\usepackage{multirow}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\newcounter{pft}
\newcolumntype{P}{%
>{\stepcounter{pft}\number\value{pft}}%
X
}
\begin{document}
\begin{table}[htb]
\centering\setcounter{pft}{-1}
\begin{tabularx}{0.95\textwidth}{P*7{X}}
\toprule
\multicolumn{1}{p{0.092\textwidth}}{Index} & Types & Names & Albedo & Brightness & Particle & Emission & Rendering\\
\midrule
& & & & & & & \\
\midrule
& \multirow{4}{*}{Type 1} & & & & & & \\
& & & & & & & \\
& & & & & & & \\
& & & & & & & \\
\midrule
& \multirow{4}{*}{Type 2} & & & & & & \\
& & & & & & & \\
& & & & & & & \\
& & & & & & & \\
\midrule
& \multirow{6}{*}{Type 3} & & & & & & \\
& & & & & & & \\
& & & & & & & \\
& & & & & & & \\
& & & & & & & \\
& & & & & & & \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
我敢预测,在不久的将来,桌子会越来越少。在数据由计算机处理的时代,我们不再需要这些巨大的物体来显示数据的样子。(你什么时候手握/爪握着一本真正的电话簿?;-)
答案3
与。{NiceTabular}
nicematrix
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{*{7}{l|}l}[hlines]
Index & Types & Name & Albedo & Brightness & Particle & Emission & Rendering \\
0 \\ \Hline\Hline
1 & \Block{4-1}{Type 1} \\
2 \\
3 \\
4 \\ \Hline\Hline
5 & \Block{4-1}{Type 2} \\
6 \\
7 \\
8 \\ \Hline\Hline
9 & \Block{6-1}{Type 3} \\
10 \\
11 \\
12 \\
13 \\
14
\end{NiceTabular}
\end{document}