使用后我需要修复以下错误\addlinespace
放错位置的 \noalign。\addlinespace ->\noalign {\ifnum 0=`}\fi @ifnextchar [{@addspace }{@addsp... l.25 \end {tblr}
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray, booktabs}
\UseTblrLibrary{booktabs}
\begin{document}
\begin{tblr}{
width = 0.5\linewidth, colspec = {XX}, rowhead = 1,
row{odd} = {gray!10}, row{even} = {gray!30}, row{1} = {blue!5},
}
\toprule[1.5pt]
One & Two \\
\midrule
1 & 2 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
9 & 10 \\
\addlinespace
11 & 12 \\
13 & 14 \\
15 & 16 \\
17 & 18 \\
19 & 20 \\
\bottomrule[1.5pt]
\end{tblr}
\end{document}
答案1
使用 2021N 版本 (2021-09-01)tabularray
包中,您可以将\addlinespace
命令与booktabs
库一起使用。
注意,一半垂直空间被添加到前一行,另一半被添加到当前行。这使得行颜色看起来更好。
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\begin{tblr}{
width = 0.5\linewidth, colspec = {XX}, rowhead = 1,
row{odd} = {gray9!50}, row{even} = {gray9}, row{1} = {blue9},
}
\toprule[1.5pt]
One & Two \\
\midrule
1 & 2 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
9 & 10 \\
\addlinespace
11 & 12 \\
13 & 14 \\
15 & 16 \\
17 & 18 \\
19 & 20 \\
\bottomrule[1.5pt]
\end{tblr}
\end{document}