为什么我的表格超出了边距?

为什么我的表格超出了边距?

在此处输入图片描述

\begin{table}[H]
\small
\centering
\caption{Specification sheet for the distillation column DC-01}
\label{tab:dc spec sheet}
\begin{tabular}{p{2.8cm}p{2.8cm}p{2.8cm}p{2.8cm}p{2.8cm}p{2.8cm}}
\hline
\toprule
\multicolumn{6}{p{17cm}}{Design intent: To remove dimethyl phosphate from phosphorous acid, the distillate stream is designed to have a composition of 98\% dimethyl phosphate, whilst the bottoms stream is designed to have a composition of 99.8\% phosphorous acid. The distillate stream will be sent to storage, whilst the bottoms stream will be split with one stream going to the flaker, and the other going to the blenders.}\\
\hline
\toprule
\multicolumn{3}{p{8.5cm}}{Specification} & \multicolumn{3}{m{8.5cm}}{Value}\\
\midrule
\multicolumn{3}{p{8.5cm}}{Column type} & \multicolumn{3}{p{8.5cm}}{Packed column}\\
\multicolumn{3}{p{8.5cm}}{Column diameter} & \multicolumn{3}{p{8.5cm}}{0.11 m top, 0.26 m bottom}\\
\multicolumn{3}{p{8.5cm}}{Column height} & \multicolumn{3}{p{8.5cm}}{2.4 m}\\
\multicolumn{3}{p{8.5cm}}{Average column temperature} & \multicolumn{3}{p{8.5cm}}{117 \degree{C}}\\
\multicolumn{3}{p{8.5cm}}{Average column pressure} & \multicolumn{3}{p{8.5cm}}{0.1 bar}\\
\multicolumn{3}{p{8.5cm}}{Shell material} & \multicolumn{3}{p{8.5cm}}{Stainless steel 316 lined with PFA}\\
\multicolumn{3}{p{8.5cm}}{Shell thickness} & \multicolumn{3}{p{8.5cm}}{4 mm top, 5 mm bottom}\\
\multicolumn{3}{p{8.5cm}}{Insulation} & \multicolumn{3}{p{8.5cm}}{Rockwool 160 (mineral wool)}\\
\multicolumn{3}{p{8.5cm}}{Vessel Support} & \multicolumn{3}{p{8.5cm}}{Skirt support}\\
\multicolumn{3}{p{8.5cm}}{Skirt thickness} & \multicolumn{3}{p{8.5cm}}{6 mm}\\
\hline
\toprule
\multicolumn{6}{p{17cm}}{Internal flowrates and conditions}\\
\hline
\toprule
& Liquid (kg/h) & Vapour (kg/h) & Temp (\degree{C}) & Pres. (bar) & Density (kg/m$^3$)\\
\midrule
Feed & 1231.0 & - & 80 & 0.1 & 1520\\
Overhead vapour & - & 43.6 & 104 & 0.1 & 0.39\\
Reflux liquid & 21.7 & - & 40 & 0.1 & 1323\\
Top product & 21.9 & - & 40 & 0.1 & 1323\\
Bottom product & 1209.1 & - & 130 & 0.1 & 1525\\
\hline
\toprule
\multicolumn{3}{p{8.5cm}}{Specification} & \multicolumn{3}{m{8.5cm}}{Value}\\
\midrule
\multicolumn{3}{p{8.5cm}}{Packing type} & \multicolumn{3}{m{8.5cm}}{Mellapak\texttrademark\ 250Y}\\
\multicolumn{3}{p{8.5cm}}{Packing material} & \multicolumn{3}{m{8.5cm}}{Stainless steel 316L}\\
\multicolumn{3}{p{8.5cm}}{Number of stages} & \multicolumn{3}{m{8.5cm}}{6 (excluding reboiler and condenser)}\\
\multicolumn{3}{p{8.5cm}}{Feed location} & \multicolumn{3}{m{8.5cm}}{Stage 3}\\
\multicolumn{3}{p{8.5cm}}{Packing size} & \multicolumn{3}{m{8.5cm}}{10 mm top, 25 mm bottom}\\
\multicolumn{3}{p{8.5cm}}{\% Flood} & \multicolumn{3}{m{8.5cm}}{70}\\
\multicolumn{3}{p{8.5cm}}{$\Delta$P/zone} & \multicolumn{3}{m{8.5cm}}{0.0004 bar/m}\\
\multicolumn{3}{p{8.5cm}}{$\Delta$P column} & \multicolumn{3}{m{8.5cm}}{0.001 bar}\\
\multicolumn{3}{p{8.5cm}}{HETP} & \multicolumn{3}{m{8.5cm}}{0.4 m}\\
\hline
\toprule
\multicolumn{6}{p{17cm}}{Condenser CON-01}\\
\hline
\toprule
\multicolumn{3}{p{8.5cm}}{Specification} & \multicolumn{3}{m{8.5cm}}{Value}\\
\midrule
\multicolumn{3}{p{8.5cm}}{Condenser type} & \multicolumn{3}{m{8.5cm}}{Shell and tube}\\
\multicolumn{3}{p{8.5cm}}{Cooling fluid} & \multicolumn{3}{m{8.5cm}}{Water}\\
\multicolumn{3}{p{8.5cm}}{Heat exchange area} & \multicolumn{3}{m{8.5cm}}{0.33 m$^2$}\\
\multicolumn{3}{p{8.5cm}}{Number of tubes} & \multicolumn{3}{m{8.5cm}}{3}\\
\multicolumn{3}{p{8.5cm}}{Length} & \multicolumn{3}{m{8.5cm}}{1.97 m}\\
\multicolumn{3}{p{8.5cm}}{Shell diameter} & \multicolumn{3}{m{8.5cm}}{0.1 m}\\
\multicolumn{3}{p{8.5cm}}{Number of baffles} & \multicolumn{3}{m{8.5cm}}{19}\\
\multicolumn{3}{p{8.5cm}}{Baffle spacing} & \multicolumn{3}{m{8.5cm}}{0.1 m}\\
\hline
\toprule
\multicolumn{6}{p{17cm}}{Reboiler RB-01}\\
\hline
\toprule
\multicolumn{3}{p{8.5cm}}{Specification} & \multicolumn{3}{m{8.5cm}}{Value}\\
\midrule
\multicolumn{3}{p{8.5cm}}{Reboiler type} & \multicolumn{3}{m{8.5cm}}{Forced circulation}\\
\multicolumn{3}{p{8.5cm}}{Thermal fluid} & \multicolumn{3}{m{8.5cm}}{Steam}\\
\multicolumn{3}{p{8.5cm}}{Heat exchange area} & \multicolumn{3}{m{8.5cm}}{5.45 m$^2$}\\
\multicolumn{3}{p{8.5cm}}{Number of tubes} & \multicolumn{3}{m{8.5cm}}{28}\\
\multicolumn{3}{p{8.5cm}}{Length} & \multicolumn{3}{m{8.5cm}}{2.44 m}\\
\multicolumn{3}{p{8.5cm}}{Shell diameter} & \multicolumn{3}{m{8.5cm}}{0.25 m}\\
\multicolumn{3}{p{8.5cm}}{Number of baffles} & \multicolumn{3}{m{8.5cm}}{23}\\
\multicolumn{3}{p{8.5cm}}{Baffle spacing} & \multicolumn{3}{m{8.5cm}}{0.1 m}\\
\bottomrule
\hline
\end{tabular}
\end{table}

答案1

这是一个将和ltablex结合起来的 解决方案。我只需要 2 个 X 列。这简化了用于表格的代码。我还加载以按小数点对齐数值。具有 6 列的行作为嵌套在 中的环境获得。我删除了所有,并将表格内的 (上面没有间距)替换为相同厚度的 。longtabletabularxsiunitxtabular*\multicolumn\hlines\toprule\midrule

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
    \usepackage[showframe, hmargin=2cm]{geometry}%
    \usepackage{lipsum}
    \usepackage{ragged2e}
 \usepackage{ltablex, caption, float, booktabs, siunitx}
\sisetup{table-number-alignment=center}

    \begin{document}

\small\keepXColumns\renewcommand{\arraystretch}{1.2}
\label{tab:dc spec sheet}
\begin{tabularx}{\linewidth}{XX}%{p{2.8cm}p{2.8cm}p{2.8cm}p{2.8cm}p{2.8cm}p{2.8cm}}
\caption{Specification sheet for the distillation column DC-01}
\label{tab:dc spec sheet}\\
\toprule
\endfirsthead
\multicolumn{2}{p{\dimexpr\linewidth-2\tabcolsep}}{Design intent: To remove dimethyl phosphate from phosphorous acid, the distillate stream is designed to have a composition of 98\,\% dimethyl phosphate, whilst the bottoms stream is designed to have a composition of 99.8\% phosphorous acid. The distillate stream will be sent to storage, whilst the bottoms stream will be split with one stream going to the flaker, and the other going to the blenders.}\\
\midrule[\heavyrulewidth]
Specification & Value\\
\midrule
Column type & Packed column\\
Column diameter & 0.11 m top, 0.26 m bottom\\
Column height & 2.4 m\\
Average column temperature & \SI{117}{\celsius}\\
Average column pressure & 0.1 bar\\
Shell material & Stainless steel 316 lined with PFA\\
Shell thickness & 4 mm top, 5 mm bottom\\
Insulation & Rockwool 160 (mineral wool)\\
Vessel Support & Skirt support\\
Skirt thickness & 6 mm\\
\midrule[\heavyrulewidth]
\multicolumn{2}{p{\dimexpr\linewidth-2\tabcolsep}}{Internal flowrates and conditions}\\
\midrule[\heavyrulewidth]
\multicolumn{2}{p{\dimexpr\linewidth-2\tabcolsep}}{%
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}lS[table-format=4.1]S[table-format=2.1]S[table-format=3.0]S[table-format=1.1]S[table-format=4.2]}%{*{6}{p{\dimexpr(\linewidth-2\tabcolsep)/6\relax}}}
&{Liquid (kg/h)} & {Vapour (kg/h)} & {Temp (\si{\celsius})} & {Pres. (bar)} & {Density (kg/m$^3$)}\\
\midrule
Feed & 1231.0 &{–} & 80 & 0.1 & 1520\\
Overhead vapour &{–} & 43.6 & 104 & 0.1 & 0.39\\
Reflux liquid & 21.7 &{–} & 40 & 0.1 & 1323\\
Top product & 21.9 &{–} & 40 & 0.1 & 1323\\
Bottom product & 1209.1 &{–} & 130 & 0.1 & 1525\\
\end{tabular*}
}\\%
\midrule[\heavyrulewidth]
Specification & Value\\
\midrule
Packing type & Mellapak\texttrademark\ 250Y\\
Packing material & Stainless steel 316L\\
Number of stages & 6 (excluding reboiler and condenser)\\
Feed location & Stage 3\\
Packing size & 10 mm top, 25 mm bottom\\
\% Flood & 70\\
$\Delta$P/zone & 0.0004 bar/m\\
$\Delta$P column & 0.001 bar\\
HETP & 0.4 m\\
\midrule[\heavyrulewidth]
\multicolumn{2}{p{\dimexpr\linewidth-2\tabcolsep}}{Condenser CON-01}\\
\midrule[\heavyrulewidth]
Specification & Value\\
\midrule
Condenser type & Shell and tube\\
Cooling fluid & Water\\
Heat exchange area & 0.33 m$^2$\\
Number of tubes & 3\\
Length & 1.97 m\\
Shell diameter & 0.1 m\\
Number of baffles & 19\\
Baffle spacing & 0.1 m\\
\midrule[\heavyrulewidth]
\multicolumn{2}{p{\dimexpr\linewidth-2\tabcolsep}}{Reboiler RB-01}\\
\midrule[\heavyrulewidth]
Specification & Value\\
\midrule
Reboiler type & Forced circulation\\
Thermal fluid & Steam\\
Heat exchange area & 5.45 m$^2$\\
Number of tubes & 28\\
Length & 2.44 m\\
Shell diameter & 0.25 m\\
Number of baffles & 23\\
Baffle spacing & 0.1 m\\
\bottomrule
\hline
\end{tabularx}    

    \end{document} 

在此处输入图片描述 在此处输入图片描述

答案2

在您的 MWE 中我做了以下更改:

  • 用于\tabularx表格环境。有了它,表格就可以适应页面的宽度
  • 用于siunitx表中的所有单位
  • 主表只有两列
  • 表格中有 6 列的部分设置为嵌套表格
  • 删除重复“规格”和“值”的行
  • 定义一些新命令以简化表格的输入

经过这样的修改,表格可以放在一页中:

\documentclass[11pt,a4paper]{article}
\usepackage{booktabs, tabularx}
\usepackage{siunitx}

\usepackage[showframe,
            margin=2cm]{geometry}

 \newcommand\mcx[1]{\multicolumn{1}{>{\centering\arraybackslash}X}{#1}}
\newcommand\mcpp[1]{\multicolumn{2}{p{\dimexpr\linewidth-2\tabcolsep}}{#1}}
 \newcommand\mct[1]{\multicolumn{2}{@{}p{\linewidth}@{}}{#1}}

\begin{document}
    \begin{table}[ht]
\small
\centering
\caption{Specification sheet for the distillation column DC-01}
    \label{tab:dc spec sheet}
\begin{tabularx}{\linewidth}{XX}
    \toprule
\mcpp{Design intent: To remove dimethyl phosphate from phosphorous acid, the distillate stream is designed to have a composition of 98\% dimethyl phosphate, whilst the bottoms stream is designed to have a composition of 99.8\% phosphorous acid. The distillate stream will be sent to storage, whilst the bottoms stream will be split with one stream going to the flaker, and the other going to the blenders.}      \\
    \midrule[1pt]
Specification               & Value                                 \\
    \midrule
Column type                 & Packed column                         \\
Column diameter             & \SI{0.11}{m} top, \SI{0.26}{m} bottom \\
Column height               & \SI{2.4}{m}                           \\
Average column temperature  & \SI{117}{\degreeCelsius}              \\
Average column pressure     & 0.1 bar                               \\
Shell material              & Stainless steel 316 lined with PFA    \\
Shell thickness             & \SI{4}{mm} top, \SI{5}{mm} bottom     \\
Insulation                  & Rockwool 160 (mineral wool)           \\
Vessel Support              & Skirt support                         \\
Skirt thickness             & \SI{6}{mm}                            \\  
    \midrule[1pt]
\mcpp{Internal flow rates and conditions}                           \\
    \midrule[1pt]
\mct{
\begin{tabularx}{\linewidth}{p{0.3\linewidth}
                             S[table-format=4.2]
                             S[table-format=2.1]
                             S[table-format=3.0]
                             S[table-format=1.1]
                             S[table-format=4.2]
                             }
                &   \mcx{Liquid (kg/h)}
                            &  \mcx{Vapour (kg/h)}
                                    &   \mcx{Temperature (\si{\degreeCelsius})}
                                            &   \mcx{Presure (bar)}
                                                    &   \mcx{Density (\si{kg/m^3})} \\
    \midrule[1pt]
Feed            & 1231.0    & {--}  & 80    & 0.1   & 1520  \\
Overhead vapour & {--}      & 43.6  & 104   & 0.1   & 0.39  \\
Reflux liquid   & 21.7      & {--}  & 40    & 0.1   & 1323  \\
Top product     & 21.9      & {--}  & 40    & 0.1   & 1323  \\
Bottom product  & 1209.1    & {--}  & 130   & 0.1   & 1525  \\
\end{tabularx}  
    }                                                               \\
    \midrule[1pt]
Specification               & Value                                 \\
    \midrule
Packing type                & Mellapak\texttrademark\ 250Y          \\
Packing material            & Stainless steel 316L                  \\
Number of stages            & 6 (excluding reboiler and condenser)  \\
Feed location               & Stage 3                               \\
Packing size                & \SI{10}{mm} top, \SI{25}{mm} bottom   \\
\% Flood                    & 70                                    \\
$\Delta$P/zone              & \SI{0.0004}{\bar/m}                   \\
$\Delta$P column            & \SI{0.001}{\bar}                      \\
HETP                        & \SI{0.4}{m}                           \\
    \midrule[1pt]
\mcpp{Condenser CON-01}                                             \\
%    \midrule[1pt]
%Specification               & Value                                 \\
    \midrule
Condenser type              & Shell and tube                        \\
Cooling fluid               & Water                                 \\
Heat exchange area          & \SI{0.33}{\cubic\metre}               \\
Number of tubes             &  3                                    \\
Length                      & \SI{1.97}{m}                          \\
Shell diameter              & \SI{0.1}{m}                           \\
Number of baffles           & 19                                    \\
Baffle spacing              & \SI{0.1}{m}                           \\
    \midrule[1pt]
\mcpp{Reboiler RB-01}                                               \\
%    \midrule[1pt]
%Specification               & Value                                 \\
    \midrule
Reboiler type               & Forced circulation                    \\
Thermal fluid               & Steam                                 \\
Heat exchange area          & \SI{5.45}{\square\metre}              \\
Number of tubes             & 28                                    \\
Length                      & \SI{2.44}{m}                          \\
Shell diameter              & \SI{0.25}{m}                          \\
Number of baffles           & 23                                    \\
Baffle spacing              & \SI{0.1}{m}                           \\
    \bottomrule
\end{tabularx}
    \end{table}
\end{document}

以上代码也可按照ltablex建议使用伯纳德在他的回答中。在这种情况下,您可以将字体大小增加到\normalsize

在此处输入图片描述

答案3

这是一个使用环境的解决方案tabularx,将宽度设置为 ,\textwidth并设置五列类型X,而不是tabular环境。请注意,环境内使用的其他列宽tabularx不是绝对的,而是相对于 计算的\textwidth。使用此解决方案,它是不是有必要减小表格中使用的字体大小(例如\small,通过指令)。

此外,请注意,我已删除所有\hline指令,并在选定位置插入了一些垂直空白(via \addlinespace)。我还重新组织了标题材料。特别是,由于“设计意图”内容似乎是一个通用图例(或介绍),似乎不属于表格部分,因此我将其放在指令上方\begin{tabularx}

在此处输入图片描述

\documentclass{article}
\usepackage[a4paper,margin=2cm]{geometry} % based on a comment by the OP
\usepackage{booktabs,tabularx,siunitx,caption,calc}
\captionsetup{skip=0.5\baselineskip,labelfont=bf}

\newlength\mylen % set up a special length variable
\setlength\mylen{0.5\textwidth-\tabcolsep} % usable width for 3-column material
\newcolumntype{P}{@{}p{\mylen}}
\newcolumntype{Q}{p{\mylen}@{}}
\newcommand\mc[2]{\multicolumn{3}{#1}{#2}} % handy shortcut macro

\begin{document}

\setcounter{table}{28} % just for this example :-)

\begin{table}[p!]
\setlength\tabcolsep{3pt}

\caption{Specification sheet for the distillation column DC-01}
\label{tab:dc spec sheet}

Design intent: To remove dimethyl phosphate from phosphorous acid, the 
distillate stream is designed to have a composition of 98\%~dimethyl 
phosphate, whilst the bottoms stream is designed to have a composition of 
99.8\%~phosphorous acid. The distillate stream will be sent to storage, 
whilst the bottoms stream will be split with one stream going to the flaker, 
and the other going to the blenders.

\begin{tabularx}{\textwidth}{@{} l *{5}{X} @{}}
\addlinespace
\toprule
\mc{P}{Specification} & \mc{Q}{Value}\\
\midrule
\mc{P}{Column type}     & \mc{Q}{Packed column}\\
\mc{P}{Column diameter} & \mc{Q}{0.11 m top, 0.26 m bottom}\\
\mc{P}{Column height}   & \mc{Q}{2.4 m}\\
\mc{P}{Average column temperature} & \mc{Q}{\SI{117}{\celsius}}\\
\mc{P}{Average column pressure} & \mc{Q}{0.1 bar}\\
\mc{P}{Shell material}  & \mc{Q}{Stainless steel 316 lined with PFA}\\
\mc{P}{Shell thickness} & \mc{Q}{4 mm top, 5 mm bottom}\\
\mc{P}{Insulation}      & \mc{Q}{Rockwool 160 (mineral wool)}\\
\mc{P}{Vessel Support}  & \mc{Q}{Skirt support}\\
\mc{P}{Skirt thickness} & \mc{Q}{6 mm}\\
\bottomrule
\addlinespace
& \multicolumn{5}{@{}c@{}}{Internal flowrates and conditions}\\
\cmidrule(l){2-6}
& Liquid (kg/h) & Vapour (kg/h) & Temp (\si{\celsius}) 
& Pres.\ (bar)  & Density (kg/m$^3$)\\
\midrule
Feed            & 1231.0 & --   & 80  & 0.1 & 1520\\
Overhead vapour & --     & 43.6 & 104 & 0.1 & 0.39\\
Reflux liquid   & 21.7   & --   & 40  & 0.1 & 1323\\
Top product     & 21.9   & --   & 40  & 0.1 & 1323\\
Bottom product  & 1209.1 & --   & 130 & 0.1 & 1525\\
\bottomrule
\addlinespace\addlinespace
\mc{P}{Specification}    & \mc{Q}{Value}\\
\midrule
\mc{P}{Packing type}     & \mc{Q}{Mellapak\texttrademark\ 250Y}\\
\mc{P}{Packing material} & \mc{Q}{Stainless steel 316L}\\
\mc{P}{Number of stages} & \mc{Q}{6 (excluding reboiler and condenser)}\\
\mc{P}{Feed location}    & \mc{Q}{Stage 3}\\
\mc{P}{Packing size}     & \mc{Q}{10 mm top, 25 mm bottom}\\
\mc{P}{\% Flood}         & \mc{Q}{70}\\
\mc{P}{$\Delta$P/zone}   & \mc{Q}{0.0004 bar/m}\\
\mc{P}{$\Delta$P column} & \mc{Q}{0.001 bar}\\
\mc{P}{HETP}             & \mc{Q}{0.4 m}\\
\bottomrule
\addlinespace\addlinespace
\multicolumn{6}{@{}p{\textwidth}@{}}{Condenser CON-01}\\
%%\toprule
\mc{P}{Specification}      & \mc{Q}{Value}\\
\midrule
\mc{P}{Condenser type}     & \mc{Q}{Shell and tube}\\
\mc{P}{Cooling fluid}      & \mc{Q}{Water}\\
\mc{P}{Heat exchange area} & \mc{Q}{\SI{0.33}{\meter\squared}}\\
\mc{P}{Number of tubes}    & \mc{Q}{3}\\
\mc{P}{Length}             & \mc{Q}{1.97 m}\\
\mc{P}{Shell diameter}     & \mc{Q}{0.1 m}\\
\mc{P}{Number of baffles}  & \mc{Q}{19}\\
\mc{P}{Baffle spacing}     & \mc{Q}{0.1 m}\\
\bottomrule
\addlinespace\addlinespace
\multicolumn{6}{@{}p{\textwidth}@{}}{Reboiler RB-01}\\
%%\toprule
\mc{P}{Specification}      & \mc{Q}{Value}\\
\midrule
\mc{P}{Reboiler type}      & \mc{Q}{Forced circulation}\\
\mc{P}{Thermal fluid}      & \mc{Q}{Steam}\\
\mc{P}{Heat exchange area} & \mc{Q}{\SI{5.45}{\meter\squared}}\\
\mc{P}{Number of tubes}    & \mc{Q}{28}\\
\mc{P}{Length}             & \mc{Q}{2.44 m}\\
\mc{P}{Shell diameter}     & \mc{Q}{0.25 m}\\
\mc{P}{Number of baffles}  & \mc{Q}{23}\\
\mc{P}{Baffle spacing}     & \mc{Q}{0.1 m}\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

相关内容