如何实现表格中行高可变?
具体来说,在下面的 MWE 中,我想降低第 2-3 行和第 9-11 行的高度,如图所示。
谢谢你的帮助!
梅威瑟:
\documentclass[class=scrreprt,fontsize=10pt]{standalone}
\usepackage{booktabs}
\aboverulesep=0ex
\belowrulesep=0ex
\usepackage{multirow}
\usepackage{array}
\newcolumntype{?}{!{\vrule width 1pt}}
\begin{document}
\renewcommand{\arraystretch}{1.7}%
\begin{tabular}{
@{}?r|
>{\centering\arraybackslash\leavevmode}p{0.7cm}|
>{\centering\arraybackslash\leavevmode}p{0.7cm}
?@{}%
}
\multicolumn{3}{c}{\textbf{Performance summary}}\\
\cmidrule[1.0pt]{1-3}
\multirow{2}{*}{\textbf{Technology}}& \multicolumn{2}{c?}{16 nm FF}\\
& \multicolumn{2}{c?}{CMOS}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Supply}}& \multicolumn{2}{c?}{0.9 V}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Sampling rate}}& \multicolumn{2}{c?}{1-500 MS/s}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Resolution}}& \multicolumn{2}{c?}{11.5 bit}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Input range}}& \multicolumn{2}{c?}{1.8 V$_{pp,d}$}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{ERBW}}& \multicolumn{2}{c?}{900 MHz}\\
\cmidrule[1.0pt]{1-3}
\multicolumn{1}{?r|}{\textbf{Performance}}& \multicolumn{2}{c?}{\textbf{Reference}}\\
\multicolumn{1}{?r|}{\textbf{with Nyquist}}& \multicolumn{2}{c?}{\textbf{regulation}}\\
\cmidrule[0.5pt]{2-3}
\multicolumn{1}{?r|}{\textbf{input}}& \textbf{OFF} &\textbf{ON}\\
\cmidrule[0.5pt]{1-3}
\multicolumn{1}{?r|}{\textbf{ENOB [bit]}}& 10.16 &10.05\\
\midrule%
\multicolumn{1}{?r|}{\textbf{SNDR [dB]}}& 62.9 &62.3\\
\midrule%
\multicolumn{1}{?r|}{\textbf{SFDR [dB]}}& 75.5 &75.5\\
\midrule%
\multicolumn{1}{?r|}{\textbf{$|$THD$|$ [dB]}}& 71.7 &71.8\\
\cmidrule[1.0pt]{1-3}
\multicolumn{1}{?r|}{\textbf{Power [mW]}}& 2.8 &3.3\\
\midrule%
\multicolumn{1}{?r|}{\textbf{FoM$_{W}$ [fJ/c.s.]}}& 4.9 &6.2\\
\midrule%
\multicolumn{1}{?r|}{\textbf{FoM$_{S}$ [dB]}}& 172.4 &171.1\\
\cmidrule[1.0pt]{1-3}
\multicolumn{1}{?r|}{\textbf{Core area}}& \multicolumn{2}{c?}{0.0084 mm$^2$}\\
\cmidrule[1.0pt]{1-3}
\end{tabular}%
\end{document}%
答案1
使用带有库的tabularray
包:tblr
siunitx
\documentclass[class=scrreprt,fontsize=10pt, border=3mm]{standalone}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\begin{document}
\begin{tblr}{hline{2,8,13,Y,Z}=1pt, hline{3-7,9-12,14-16},
vline{2,3} = {2-Z}{solid}, vline{1,Z} = {2-Z}{1pt},
colspec = { Q[r, wd=9em, font=\bfseries]
*{2}{Q[c, si={table-format=3.2}, wd=4em]}
},
row{1} = {font=\bfseries}
}
\SetCell[c=3]{c} Performance summary & & \\
Technology & \SetCell[c=2]{c} {{{\qty{16}{nm} FF, CMOS}}}
& \\
Supply & \SetCell[c=2]{c} {{{\qty{0.9}{V} }}} & \\
Sampling rate & \SetCell[c=2]{c} {{{\qtyrange{1}{500}{MS/s} }}}
& \\
Resolution & \SetCell[c=2]{c} {{{\qty{11.5}{bit} }}} & \\
Input range & \SetCell[c=2]{c} {{{\qty{1.8}{V_{pp,d}} }}}
& \\
ERBW & \SetCell[c=2]{c} {{{\qty{900}{MHz} }}} & \\
\SetCell[r=2]{r}
Performance with Nyquist input
& \SetCell[c=2]{c} \textbf{Reference regulation}
& \\
& \textbf{OFF} & \textbf{ON} \\
ENOB [bit] & 10.16 & 10.05 \\
SNDR [dB] & 62.9 & 62.3 \\
SFDR [dB] & 75.5 & 75.5 \\
$|$THD$|$ [dB] & 71.7 & 71.8 \\
Power [mW] & 2.8 & 3.3 \\
FoM\textsubscript{W} [fJ/c.s.]
& 4.9 & 6.2 \\
FoM\textsubscript{S} [dB]
& 172.4 & 171.1 \\
Core area & \SetCell[c=2]{c} {{{\qty{0.0084}{mm^2} }}} & \\
\end{tblr}
\end{document}
答案2
使用makecell
\documentclass[class=scrreprt,fontsize=10pt]{standalone}
\usepackage{booktabs}
\aboverulesep=0ex
\belowrulesep=0ex
\usepackage{multirow}
\usepackage{array}
\newcolumntype{?}{!{\vrule width 1pt}}
\usepackage{makecell}
\begin{document}
\renewcommand{\arraystretch}{1.7}%
\begin{tabular}{
@{}?r|
>{\centering\arraybackslash\leavevmode}p{0.7cm}|
>{\centering\arraybackslash\leavevmode}p{0.7cm}
?@{}%
}
\multicolumn{3}{c}{\textbf{Performance summary}}\\
\cmidrule[1.0pt]{1-3}
\textbf{Technology}&\multicolumn{2}{c}{\makecell{16 nm FF \\ CMOS}}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Supply}}& \multicolumn{2}{c?}{0.9 V}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Sampling rate}}& \multicolumn{2}{c?}{1-500 MS/s}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Resolution}}& \multicolumn{2}{c?}{11.5 bit}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{Input range}}& \multicolumn{2}{c?}{1.8 V$_{pp,d}$}\\
\midrule%
\multicolumn{1}{?r|}{\textbf{ERBW}}& \multicolumn{2}{c?}{900 MHz}\\
\cmidrule[1.0pt]{1-3}
\multirow{2}{*}{\textbf{\makecell[r]{Performance\\ with Nyquist\\ Input}}}& \multicolumn{2}{c?}{\textbf{\makecell{Reference\\ regulation}}}\\
\cmidrule[0.5pt]{2-3}
& \textbf{OFF} &\textbf{ON}\\
\cmidrule[0.5pt]{1-3}
\multicolumn{1}{?r|}{\textbf{ENOB [bit]}}& 10.16 &10.05\\
\midrule%
\multicolumn{1}{?r|}{\textbf{SNDR [dB]}}& 62.9 &62.3\\
\midrule%
\multicolumn{1}{?r|}{\textbf{SFDR [dB]}}& 75.5 &75.5\\
\midrule%
\multicolumn{1}{?r|}{\textbf{$|$THD$|$ [dB]}}& 71.7 &71.8\\
\cmidrule[1.0pt]{1-3}
\multicolumn{1}{?r|}{\textbf{Power [mW]}}& 2.8 &3.3\\
\midrule%
\multicolumn{1}{?r|}{\textbf{FoM$_{W}$ [fJ/c.s.]}}& 4.9 &6.2\\
\midrule%
\multicolumn{1}{?r|}{\textbf{FoM$_{S}$ [dB]}}& 172.4 &171.1\\
\cmidrule[1.0pt]{1-3}
\multicolumn{1}{?r|}{\textbf{Core area}}& \multicolumn{2}{c?}{0.0084 mm$^2$}\\
\cmidrule[1.0pt]{1-3}
\end{tabular}%
\end{document}%