我应该将支柱放在多行/列表的什么位置?

我应该将支柱放在多行/列表的什么位置?

在第二行和最后一项中,“同步二进制系统”与表格线接触。我应该把支柱放在哪里?以及如何将“i”“j”和“k”放置在合并行的中心?

\documentclass{article}
\usepackage{multirow}
\usepackage{pbox}%to break line with section
\usepackage{booktabs}
\usepackage[margin=1in,left=0.75in,right=0.75in]{geometry}
\begin{document}
\begin{flushleft}
\newcommand\T{\rule{0pt}{3.6ex}} % Top strut
\newcommand\B{\rule[-3.6ex]{0pt}{0pt}} % Bottom strut
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline\T\B
\multirow{2}{*}{i} & \multirow{2}{*}{j} & \multirow{2}{*}{k} &       \multicolumn{5}{c|}{$A_{ij, k}^{*}$} \\ \cline{4-8}
              &                   &                   &   Undistorted&    \pbox{20cm}{Rotationally \\ Distorted}&    Tidally Distorted&    \pbox{20cm}{Rotationally\\Tidally Distorted}&  \pbox{20cm}{Synchronous\\ Binary \\System } \\ \hline
             2 &                  2 &                  1 &    7.2&    0.03&    1.9&    0.99&  -3.7 \\ \hline
             3 &                  3 &                  1 &    10.6&    -10.6&    1.43&    0.22&  -6.37 \\ \hline
\end{tabular}
\end{flushleft}
\end{document} 

答案1

我添加了siunitx在数学模式下小数点上的数字对齐,以及一些行填充,因为您的 struts 似乎是为此设计的。填充在这里使用cellspace包实现,它允许您在列中单元格的顶部和底部定义最小垂直填充,其中说明符以字母 为前缀S,或者,以siunitx字母 为前缀C。还有 \ pbox is replaced withmakecell , which allows for line breaks via the\makecell ,multirowcell` 和其他一些命令:

\documentclass{article}

\usepackage{booktabs, multirow, makecell, cellspace}
\setlength\cellspacetoplimit{8pt}
\setlength\cellspacebottomlimit{8pt}
\usepackage[margin=1in,left=0.75in,right=0.75in, showframe]{geometry}
\usepackage{siunitx}
\addparagraphcolumntypes{S}

 \begin{document}
\begin{flushleft}
\sisetup{table-format=1.2, table-number-alignment=center}
\begin{tabular}{|*{3}{Cc|}S[table-format=2.1]|S[table-format=-2.1]|S|S|S[table-format=-1.2]|}
\hline
\multirowcell{5}[0.5ex]{i} & \multirowcell{5}[0.5ex]{j} & \multirowcell{5}[0.5ex]{k} & \multicolumn{5}{Cc|}{$A_{ij, k}^{*}$}
 \\ \cline{4-8}
              & & & {Undistorted} & \multicolumn{1}{Cc|}{\makecell[l]{Rotationally \\ Distorted}} & {Tidally Distorted} & {\makecell[l]{Rotationally\\Tidally Distorted}}& {\makecell[l]{Synchronous\\ Binary System}} \\ \hline
             2 & 2 & 1 & 7.2& 0.03& 1.9& 0.99& -3.7 \\ \hline
             3 & 3 & 1 & 10.6& -10.6& 1.43& 0.22& -6.37 \\ \hline
\end{tabular}
\end{flushleft}
\end{document} 

在此处输入图片描述

答案2

说实话,我觉得没有必要使用multirow以及您建议的对齐方式。请考虑使用下面更新后的表格:

在此处输入图片描述

\documentclass{article}

\usepackage{booktabs,makecell}
\usepackage[margin=1in]{geometry}

\begin{document}

\noindent
\begin{tabular}{ *{8}{c} }
  \toprule
   & & & \multicolumn{5}{c}{$A_{i,j,k}^*$} \\
  \cmidrule(lr){4-8}
  $i$ & $j$ & $k$ & Undistorted & \makecell[b]{Rotationally \\ Distorted} & \makecell[b]{Tidally \\ Distorted} & 
    \makecell[b]{Rotationally \\ Tidally Distorted} & \makecell[b]{Synchronous \\ Binary System} \\
  \midrule
  $2$ & $2$ & $1$ & $\phantom{1}7.2$ & $\phantom{-1}0.03$ & $1.9\phantom{3}$ & $0.99$ & $-3.7\phantom{7}$ \\
  $3$ & $3$ & $1$ & $ 10.6$ & $-10.6\phantom{3}$ & $1.43$ & $0.22$ & $-6.37$ \\
  \bottomrule
\end{tabular}

\end{document}

读者应该清楚,参数是ij和,k并且它们将改变的结果A_{i,j,k}^*

我使用一些 s 对齐了数字条目\phantom,并将第二行坚持使用两个单元格堆叠,所有单元格都b对齐(感谢makecell)。

相关内容