Latex 表格多列帮助

Latex 表格多列帮助

我无法理解乳胶中的多列。

\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
\usepackage{rotating}
\usepackage[colorlinks]{hyperref}

\sisetup{
 % insert global siunitx settings here
 separate-uncertainty=true,
 group-digits=false,
 round-pad=false,
 table-auto-round=true,
 group-separator={},
}

\newcolumntype{T}{S[table-format=2.1]}
\newcolumntype{U}{S[table-format=1.5(1)]}
\begin{document} 
   \begin{tabular}{ S TT UUUU }
     \toprule
     \multicolumn{2}{c}{\textbf{Mass fraction}, \textbf{Concentration}, \textbf{Density relative to \qty{4}{\degreeCelsius} water}} & \\
     \multicolumn{4}{c}{(\unit{\percent}) Volume (\unit{\percent}) Mass (\unit{\gram}/(\qty{100}{\mL}))
     \qty{10}{\degreeCelsius} \qty{20}{\degreeCelsius} \qty{25}{\degreeCelsius} \qty{30}{\degreeCelsius}} \\
     0    & 0     & 0     & 0.99973(2) & 0.99823(1) & 0.99708(3) & 0.99568(1) \\
     4.0  & 5.00  & 3.97  & 0.99258(1) & 0.99103(2) & 0.98984(2) & 0.98839(2) \\
     10.0 & 12.40 & 9.84  & 0.98393(2) & 0.98187(1) & 0.98043(2) & 0.97875(2) \\
     18.0 & 22.10 & 17.54 & 0.97473(1) & 0.97129(2) & 0.96923(1) & 0.96697(1) \\
     25.0 & 30.40 & 24.12 & 0.96665(2) & 0.96168(3) & 0.95895(2) & 0.95607(3) \\
     28.0 & 33.90 & 26.90 & 0.96268(3) & 0.95710(1) & 0.95410(3) & 0.95098(2) \\
     30.0 & 36.20 & 28.73 & 0.95977(1) & 0.95382(2) & 0.95067(2) & 0.94741(2) \\
   \bottomrule
   \end{tabular}
\end{document}

生成后看起来像这样: 矿

我怎样才能使表格的前两行看起来像下面这样?

目标

答案1

设置多列很简单,但您的表格不适合页面。

这里有两个解决方案:1)横向表格或 2)超出页面边框且宽度为零的表格:

\documentclass{article}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
\usepackage{rotating}
\usepackage[colorlinks]{hyperref}

\sisetup{
 % insert global siunitx settings here
 separate-uncertainty=true,
 group-digits=false,
 round-pad=false,
 table-auto-round=true,
 group-separator={},
}

\newcolumntype{T}{S[table-format=2.1]}
\newcolumntype{U}{S[table-format=1.5(1)]}

\begin{document}
\begin{sidewaystable}\small\centering
   \begin{tabular}{@{}S TT UUUU@{}}
     \toprule
     \textbf{Mass fraction} &\multicolumn{2}{c}{\textbf{Concentration}}&\multicolumn{4}{c}{\textbf{Density relative to \qty{4}{\degreeCelsius} water}} \\
     \cmidrule(lr){2-3}\cmidrule(l){4-7}
     {(\unit{\percent})} & {Volume (\unit{\percent})} & {Mass (\unit{\gram}/(\qty{100}{\mL}))} &
     {\qty{10}{\degreeCelsius}} & {\qty{20}{\degreeCelsius}} & {\qty{25}{\degreeCelsius}} & {\qty{30}{\degreeCelsius}} \\
     \midrule
     0    & 0     & 0     & 0.99973(2) & 0.99823(1) & 0.99708(3) & 0.99568(1) \\
     4.0  & 5.00  & 3.97  & 0.99258(1) & 0.99103(2) & 0.98984(2) & 0.98839(2) \\
     10.0 & 12.40 & 9.84  & 0.98393(2) & 0.98187(1) & 0.98043(2) & 0.97875(2) \\
     18.0 & 22.10 & 17.54 & 0.97473(1) & 0.97129(2) & 0.96923(1) & 0.96697(1) \\
     25.0 & 30.40 & 24.12 & 0.96665(2) & 0.96168(3) & 0.95895(2) & 0.95607(3) \\
     28.0 & 33.90 & 26.90 & 0.96268(3) & 0.95710(1) & 0.95410(3) & 0.95098(2) \\
     30.0 & 36.20 & 28.73 & 0.95977(1) & 0.95382(2) & 0.95067(2) & 0.94741(2) \\
   \bottomrule
   \end{tabular}
   \caption{Properties of aqueous ethanol solution (Wikipedia)}
\end{sidewaystable}

\begin{table}\small\centering\makebox[0pt]{%
   \begin{tabular}{@{}S TT UUUU@{}}
     \toprule
     \textbf{Mass fraction} &\multicolumn{2}{c}{\textbf{Concentration}}&\multicolumn{4}{c}{\textbf{Density relative to \qty{4}{\degreeCelsius} water}} \\
     \cmidrule(lr){2-3}\cmidrule(l){4-7}
      & {Volume } & {Mass } &
     & & & \\
     {(\unit{\percent})} & {(\unit{\percent})} & {(\unit{\gram}/(\qty{100}{\mL}))} &
     {\qty{10}{\degreeCelsius}} & {\qty{20}{\degreeCelsius}} & {\qty{25}{\degreeCelsius}} & {\qty{30}{\degreeCelsius}} \\
     \midrule
     0    & 0     & 0     & 0.99973(2) & 0.99823(1) & 0.99708(3) & 0.99568(1) \\
     4.0  & 5.00  & 3.97  & 0.99258(1) & 0.99103(2) & 0.98984(2) & 0.98839(2) \\
     10.0 & 12.40 & 9.84  & 0.98393(2) & 0.98187(1) & 0.98043(2) & 0.97875(2) \\
     18.0 & 22.10 & 17.54 & 0.97473(1) & 0.97129(2) & 0.96923(1) & 0.96697(1) \\
     25.0 & 30.40 & 24.12 & 0.96665(2) & 0.96168(3) & 0.95895(2) & 0.95607(3) \\
     28.0 & 33.90 & 26.90 & 0.96268(3) & 0.95710(1) & 0.95410(3) & 0.95098(2) \\
     30.0 & 36.20 & 28.73 & 0.95977(1) & 0.95382(2) & 0.95067(2) & 0.94741(2) \\
   \bottomrule
   \end{tabular}%
   }
   \caption{Properties of aqueous ethanol solution (Wikipedia)}
\end{table}
\end{document}

侧身:

在此处输入图片描述

超出边界:

在此处输入图片描述

相关内容