![长度和宽度的表格格式](https://linux22.com/image/431322/%E9%95%BF%E5%BA%A6%E5%92%8C%E5%AE%BD%E5%BA%A6%E7%9A%84%E8%A1%A8%E6%A0%BC%E6%A0%BC%E5%BC%8F.png)
梅威瑟:
\documentclass{article}
\usepackage{amsmath}
\usepackage{multirow}
\begin{table}[]
\caption{}
\label{tab:my-table}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{A} & \multirow{2}{*}{B} & \multirow{2}{*}{C} & \multirow{2}{*}{D} & \multirow{2}{*}{E} & \multicolumn{2}{c|}{F} \\ \cline{6-7}
& & & & & G & H \\ \hline
\textbf{0.2} & \textbf{0.5} & \textbf{1} & \textbf{0.2} & \textbf{0.5} & −1.8713360906 & −1.7640262021 \\ \hline
\textbf{0.3} & 0.5 & 1 & 0.2 & 0.5 & −1.9365758323 & −1.7648755545 \\ \hline
\textbf{0.4} & 0.5 & 1 & 0.2 & 0.5 & −1.9844365775 & −1.7572640364 \\ \hline
0.2 & \textbf{0.6} & 1 & 0.2 & 0.5 & −1.8893451634 & −1.7769110253 \\ \hline
0.2 & \textbf{0.7} & 1 & 0.2 & 0.5 & −1.9037201042 & −1.7845630194 \\ \hline
0.2 & \textbf{0.8} & 1 & 0.2 & 0.5 & −1.9084283289 & −1.78054097011 \\ \hline
0.2 & 0.5 & \textbf{1.1} & 0.2 & 0.5 & −1.8638586434 & −1.75716821872 \\ \hline
0.2 & 0.5 & \textbf{1.2} & 0.2 & 0.5 & −1.8563791180 & −1.75030388119 \\ \hline
0.2 & 0.5 & \textbf{1.3} & 0.2 & 0.5 & −1.8488975550 & −1.74343325690 \\ \hline
0.2 & 0.5 & 1 & \textbf{0.3} & 0.5 & −1.7816929512 & −1.67995077275 \\ \hline
0.2 & 0.5 & 1 & \textbf{0.4} & 0.5 & −1.6940695909 & −1.59754625788 \\ \hline
0.2 & 0.5 & 1 & \textbf{0.5} & 0.5 & −1.60833298231 & −1.51669912930 \\ \hline
0.2 & 0.5 & 1 & 0.2 & \textbf{0.6} & −1.79104380621 & −1.69665633242 \\ \hline
0.2 & 0.5 & 1 & 0.2 & \textbf{0.7} & −1.72028938675 & −1.63324789889 \\ \hline
0.2 & 0.5 & 1 & 0.2 & \textbf{0.8} & −1.66248454886 & −1.58021088372 \\ \hline
\end{tabular}
\end{table}
问题:如何控制此表中每个单元格的高度?
请帮我
答案1
正如@js bibra 在他的评论中提到的那样,你的问题实际上是重复的表格中的列和行填充。让我再补充一个在链接中问题的答案中给出的可能性,其中垂直填充后面建议对表格设计进行一些改进
S
siunitx
包中定义的列类型,etoolbox
用于定义用粗体数字标记单元格的强大命令的包- 垂直填充的宏
\makegapedcells
,其定义为\setcellgapes{...}
\documentclass{article}
\usepackage{makecell, multirow}
\usepackage{siunitx}
\usepackage{etoolbox}
\newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}\bfseries}
\usepackage[skip=1ex, font=small, labelfont=bf]{caption}
\begin{document}
\begin{table}[ht]
\centering
\sisetup{detect-weight,
mode=text}
\setcellgapes{5pt}
\makegapedcells
\caption{My table}
\label{tab:...}
\label{tab:my-table}
\begin{tabular}{|*{5}{S[table-format=1.1]|}
*{2}{S[table-format=-1.11]|}
}
\hline
{\multirow{2.4}{*}{A}} & {\multirow{2.4}{*}{B}} & {\multirow{2.4}{*}{C}} & {\multirow{2.4}{*}{D}} & {\multirow{2.4}{*}{E}} & \multicolumn{2}{c|}{F} \\ \cline{6-7}
& & & & & {G} & {H} \\ \hline
\B 0.2 &\B 0.5 &\B 1 &\B 0.2 &\B 0.5 & -1.8713360906 & -1.7640262021 \\ \hline
\B 0.3 & 0.5 & 1 & 0.2 & 0.5 & -1.9365758323 & -1.7648755545 \\ \hline
\B 0.4 & 0.5 & 1 & 0.2 & 0.5 & -1.9844365775 & -1.7572640364 \\ \hline
0.2 &\B 0.6 & 1 & 0.2 & 0.5 & -1.8893451634 & -1.7769110253 \\ \hline
0.2 &\B 0.7 & 1 & 0.2 & 0.5 & -1.9037201042 & -1.7845630194 \\ \hline
0.2 &\B 0.8 & 1 & 0.2 & 0.5 & -1.9084283289 & -1.78054097011 \\ \hline
0.2 & 0.5 &\B 1.1 & 0.2 & 0.5 & -1.8638586434 & -1.75716821872 \\ \hline
0.2 & 0.5 &\B 1.2 & 0.2 & 0.5 & -1.8563791180 & -1.75030388119 \\ \hline
0.2 & 0.5 &\B 1.3 & 0.2 & 0.5 & -1.8488975550 & -1.74343325690 \\ \hline
0.2 & 0.5 & 1 &\B 0.3 & 0.5 & -1.7816929512 & -1.67995077275 \\ \hline
0.2 & 0.5 & 1 &\B 0.4 & 0.5 & -1.6940695909 & -1.59754625788 \\ \hline
0.2 & 0.5 & 1 &\B 0.5 & 0.5 & -1.60833298231& -1.51669912930 \\ \hline
0.2 & 0.5 & 1 & 0.2 &\B 0.6 & -1.79104380621& -1.69665633242 \\ \hline
0.2 & 0.5 & 1 & 0.2 &\B 0.7 & -1.72028938675& -1.63324789889 \\ \hline
0.2 & 0.5 & 1 & 0.2 &\B 0.8 & -1.66248454886& -1.58021088372 \\ \hline
\end{tabular}
\end{table}
\end{document}
答案2
\renewcommand{\arraystretch}{2}
您可以使用 \arraystretch 命令增加每个单元格的高度。将值传递给参数,表示增加高度的量。
另外,请访问我的 YouTube 频道西太平洋集团用于 Latex 教程。