好的,你们都知道booktabs
禁止使用垂直规则。
但是如何处理这样的表格呢?
\begin{center}
\begin{tabular}{c|c|c|c|c|c|c|c|c}
$y$ & -2 & -1 & 0 & 1 & 2 & 3 & \ldots & 6 \\\hline
$x$ & & & & & & & &
\end{tabular}
\end{center}
或者
\begin{center}
\begin{tabular}{ccccccc}
T & 2 & 5 & 10 & 25 & 50 & 100 \\[3pt] \midrule
$x_T$ & \multicolumn{6}{c}{{\Large known}}\\[3pt]
$x'_T$ & & & & & & \\[3pt]
$x''_T$ & & & & & & \\[3pt]
$\displaystyle\frac{B}{\sqrt{n}}$ & \multicolumn{6}{c}{{\Large known}}\\[3pt]
$S_T$ & & & & & &\\
\end{tabular}
\end{center}
我觉得 T 后面应该有一个表格高度的垂直线,同时我想知道如何处理有很多列的双行表格?那么,即使是两行表格,例如两列的表格呢?
答案1
像这样:
在你的(第二个)“MWE”中,我做了两个小改动:
- 相反,
\midrule
我使用\hline
- 增加
\arraystretch
至 1.3
MWE 的基本部分是:
\begin{center}
\renewcommand\arraystretch{1.3}
\begin{tabular}{>{$\displaystyle}c<{$}|cccccc}
T & 2 & 5 & 10 & 25 & 50 & 100 \\
\hline
x_T & \multicolumn{6}{c}{{\Large known}} \\
x'_T & & & & & & \\
x''_T & & & & & & \\
\frac{B}{\sqrt{n}}
& \multicolumn{6}{c}{{\Large known}} \\
S_T & & & & & & \\
\end{tabular}
\end{center}
答案2
您可以做几件事。请注意, 如果您将和设置为 0pt,booktabs
则与混合水平和垂直规则并不矛盾。aboverulesep
\belowrulesep
\documentclass[11pt]{article}
\usepackage{fourier, erewhon} \usepackage{amsmath}
\usepackage[x11names, table]{xcolor}
\usepackage{booktabs, cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
\begin{document}
\begin{center}
\setlength\aboverulesep{0pt}
\setlength\belowrulesep{0pt}
\arrayrulecolor{LightSteelBlue3!80}
\begin{tabular}{@{}Sc!{\color{LightSteelBlue3!80}\vrule width 2pt}*{6}{Sc}@{\,\,}}
T & 2 & 5 & 10 & 25 & 50 & 100 \\ \midrule[1.2pt]
$x_T$ & \multicolumn{6}{Sc}{{\Large known}}\\
$x'_T$ & & & & & & \\
$x''_T$ & & & & & & \\
$\dfrac{B}{\sqrt{n}}$ & \multicolumn{6}{c}{{\Large known}}\\
$S_T$ & & & & & &
\end{tabular}
\end{center}
\vspace{1cm}
\[ \begin{array}{c!{\color{Grey0!65!RoyalBlue3!35!}\vrule width 6pt}*{8}{c}}
y & -2 & -1 & 0 & 1 & 2 & 3 & \ldots & 6 \\
x& & & & & & & &
\end{array} \]
\vspace{1cm}
\[
\setlength\aboverulesep{0pt}
\setlength\belowrulesep{0pt}
\arrayrulecolor{DarkSeaGreen4!75!}
\begin{array}{!{\color{DarkSeaGreen4!75!}\vrule width 1.2pt}*{9}{c}}
y & -2 & -1 & 0 & 1 & 2 & 3 & \ldots & 6 \\
x& & & & & & & & \\
\midrule[1.2pt]
\end{array} \]
\end{document}