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}

在此輸入影像描述

相關內容