Tabularx:不同宽度的列

Tabularx:不同宽度的列

我的代码如下所示。

\documentclass[fleqn,10pt]{SelfArx} % Document font size and equations flushed left

\usepackage[font=small]{caption}

% New commands
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\renewcommand{\thefootnote}{NS}

% Load packages
\usepackage{gensymb}
\usepackage{multirow}
\usepackage{tabularx}

%----------------------------------------------------------------------------------------
%   COLUMNS
%----------------------------------------------------------------------------------------

\setlength{\columnsep}{0.55cm} % Distance between the two columns of text
\setlength{\fboxrule}{0.75pt} % Width of the border around the abstract

...

\begin{table}[hbt]
\caption{Fold changes in relaxation parameters in the dorsal muscle and lumbar(/-osacral) IVDs. \\
\begin{tabularx}{\linewidth}{X*{2}{p{0.7cm}} X*{7}{p{0.9cm}}}
\toprule[1.5pt]
                              &       & \multicolumn{2}{c}{\head{Dorsal}} & \multicolumn{5}{c}{\head{IVD}}               \\
                                                            &       & \multicolumn{2}{c}{\head{muscle}}               \\ \cmidrule{3-4} \cmidrule{5-9}
           &                   &       1     & 2     & L3-L4 & L4-L5 & L5-L6 & L6-L7 & L7-S1 \\ \midrule
         & t2/t1 & 0.99$^*$  & 1.24 & 0.64  & 1.05$^*$  & 1.53  & 1.52  & 2.45  \\
\head{T$_{1\rho}$} & t3/t2 & 1.3   & 0.88 & 2.61  & 1.16  & 1.07$^*$  & 1.03$^*$  & 0.7   \\
         & t3/t1 & 1.29  & 1.1$^*$  & 1.68  & 1.22  & 1.63  & 1.56  & 1.72  \\ \midrule
         & t2/t1 & 1.18  & 1.05 & 1.07$^*$  & 1.05$^*$  & 0.83  & 1.43  & 1.32  \\
\head{T$_2$}       & t3/t2 & 0.87  & 1.03 & 0.66  & 0.67  & 0.94$^*$  & 0.69  & 0.67  \\
         & t3/t1 & 1.02$^*$  & 1.08 & 0.71  & 0.7   & 0.78  & 0.99$^*$  & 0.88 \\
\bottomrule[1.5pt]
\end{tabularx}
\label{tab:lbl}
\end{table}
\end{document}

我想要获得一个适合列宽的表格(每页有 2 列,列间距 = 0.55 厘米,列宽 ~= 7.925 厘米)。

我想减少前两列文本到单元格边框的距离,并保持后面 7 列的单元格大小相同。

刚刚从下面的答案中复制了这个 使用下面提出的解决方案后的结果

答案1

\documentclass[10pt]{article} % Document font size and equations flushed left
\usepackage{booktabs}
\usepackage{tabularx}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\begin{document} 

\noindent\hrulefill a line\hrulefill% to show the linewidth
\def\N{\phantom{0}}

\begin{center}
\begin{tabular}{@{} l l c c *5l @{}}
\toprule[1.5pt]
                              &       & \multicolumn{2}{c}{\head{Dorsal}} & \multicolumn{5}{c}{\head{IVD}} \\
                                                            &       & \multicolumn{2}{c}{\head{muscle}}               \\ \cmidrule{3-4} \cmidrule{5-9}
           &                   &       1     & 2     & L3-L4 & L4-L5 & L5-L6 & L6-L7 & L7-S1 \\ \midrule
         & t2/t1 & 0.99\rlap{$^*$}  & 1.24 & 0.64  & 1.05$^*$  & 1.53  & 1.52  & 2.45  \\
\head{T$_{1\rho}$} & t3/t2 & 1.3\N   & 0.88 & 2.61  & 1.16  & 1.07$^*$  & 1.03$^*$  & 0.7   \\
         & t3/t1 & 1.29  & 1.1\N\rlap{$^*$}  & 1.68  & 1.22  & 1.63  & 1.56  & 1.72  \\ \midrule
         & t2/t1 & 1.18  & 1.05 & 1.07$^*$  & 1.05$^*$  & 0.83  & 1.43  & 1.32  \\
\head{T$_2$}       & t3/t2 & 0.87  & 1.03 & 0.66  & 0.67  & 0.94$^*$  & 0.69  & 0.67  \\
         & t3/t1 & 1.02\rlap{$^*$}  & 1.08 & 0.71  & 0.7   & 0.78  & 0.99$^*$  & 0.88 \\
\bottomrule[1.5pt]
\end{tabular}
\end{center}

\end{document}

在此处输入图片描述

相关内容