答案1
当然你已经读过booktabs
文档并且知道你不应该使用垂直线,所以你可以只\vdots
在上面和下面放置单元格。例如,
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
\begin{tabular}{lll}
\multicolumn{1}{c}{\vdots}&\multicolumn{1}{c}{\vdots}&\multicolumn{1}{c}{\vdots}\\
\midrule
Cell 1 & Cell 2 & Cell 3 \\
\midrule
\multicolumn{1}{c}{\vdots}&\multicolumn{1}{c}{\vdots}&\multicolumn{1}{c}{\vdots}
\end{tabular}
\end{table}
\end{document}
无论如何,假设您希望保留垂直线,那么一个相对简单的方法是使用\multicolumn
s 重新设置单元格样式并将其放置\vdots
在边界处:
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}
\begin{tabular}{|l|l|l|}
\multicolumn{1}{@{\vdots}c}{}&\multicolumn{1}{@{\vdots}c}{}&\multicolumn{1}{@{\vdots}c@{\vdots}}{}\\
\hline
Cell 1 & Cell 2 & Cell 3 \\
\hline
\multicolumn{1}{@{\vdots}c}{}&\multicolumn{1}{@{\vdots}c}{}&\multicolumn{1}{@{\vdots}c@{\vdots}}{}\\
\end{tabular}
\end{table}
\end{document}
请注意,这里有一些错位,可以通过使用\vdots
没有宽度的版本来克服:
\newcommand{\narrowvdots}{\hbox to 0pt{\hss\vdots\hss}}
您可以使用破折号执行此操作,如下所示:
\documentclass{article}
\usepackage{array}
\newcommand{\myvdashes}{\raisebox{1ex}{\oalign{\vrule height 1ex\cr\vrule height
1ex\cr \vrule height 1ex}}}
\begin{document}
\begin{table}
\begin{tabular}{|l|l|l|}
\multicolumn{1}{@{\myvdashes}c@{\myvdashes}}{}&\multicolumn{1}{c@{\myvdashes}}{}&\multicolumn{1}{c@{\myvdashes}}{}\\
\hline
Cell 1 & Cell 2 & Cell 3 \\
\hline
\multicolumn{1}{@{\myvdashes}c@{\myvdashes}}{}&\multicolumn{1}{c@{\myvdashes}}{}&\multicolumn{1}{c@{\myvdashes}}{}
\end{tabular}
\end{table}
\end{document}