[Tex/LaTex] Why is the table going over margins

multicolmultirowtables

enter image description here

\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}

Best Answer

Here is a solution with ltablex which combines longtable and tabularx. I need only 2 X columns. This simplifies the code used for the table. I also load siunitx to align numerical values by their decimal dot. The rows with 6 columns are obtained as a tabular* environment nested in a \multicolumn. I deleted all \hlines, and replaced \toprules inside the table (which have no spacing above) with \midrules of the same thickness.

\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} 

enter image description here enter image description here

Related Question