# multicolumn table in latex with non si units

]1

Hi.. Can someone help me with the code for this table along with packages for units like torr and sccm

\usepackage {multirow, multicolumn}
\usepackage {siunitx, mhchem}

\begin{table}[htb]
\centering
\caption{Mean Roughness}\label{tab:openrough}
\begin{tabularx}{\textwidth}{@{}lll@{}}\hline
\multicolumn{2}{c}{Process parameters} & mean roughness (\si{\nm}) \\
Pressure (\torr) & Nitrogen flow rate (sccm) & \\
\midrule
2 & 50 & 20 \\
2 & 50 & 27 \\
\bottomrule
\end{tabularx}
\end{table}

• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that shows us what you tried so far. Please also state where exactly the problem is: Is it the colors, the linebreaks in cells, the alignment... – leandriis Jun 18 '18 at 12:59
• In order to use non SI units with the siunitx package, you can use \DeclareSIUnit\torr{torr}. – leandriis Jun 18 '18 at 13:00
• I have problems with linebreaks and alignment. I m not concerned with the color. Also \torr works with mhchem package but i m not able to declare sccm. I get a fatal error and pdf cant be generated – Sir Real Jun 18 '18 at 13:04
• Regarding the linebreaks and alignment, you might be interested in \multirow as well as \multicolumn and the makecell package. – leandriis Jun 18 '18 at 13:09
• Yes i use the '\multirow' and 'makecell' package already – Sir Real Jun 18 '18 at 13:12

With the usage of \multirow and \makecell commands, yo can achieve the following: (I have also defined two new units using the siunitx package and used S type columns for better alignment of numbers.)

\documentclass{article}

\usepackage{makecell}
\usepackage{siunitx}
\usepackage{multirow}
\usepackage{booktabs}

\DeclareSIUnit\sccm{sccm}
\DeclareSIUnit\torr{torr}

\begin{document}

\begin{tabular}{cS[table-format=3]S[table-format=2.2]@{${}\pm{}$}S[table-format=2.2]}
\toprule
\multicolumn{2}{c}{{process parameters}} & \multicolumn{2}{c}{\multirow{3}{*}{\makecell[cc]{mean \\ roughness \\(in \si{\nm})}}}\\
\cmidrule(rl){1-2}
\makecell[cc]{pressure\\ (in \si{\torr})} & {\makecell[cc]{nitrogen gas flow \\(in \si{\sccm})}}\\
\midrule
\multirow{2}{*}{2} & 50  & 21.7 & 12.75\\
& 150 & 20.5 & 4.8\\
\midrule
\multirow{2}{*}{9} & 50  & 51.14 & 17.9 \\
& 150 & 24.8 & 12.7\\
\bottomrule
\end{tabular}

\end{document}

• It works well except that i get an error as !Undefined control sequence \DeclareSIUnit\sccm{sccm} – Sir Real Jun 18 '18 at 13:49
• Do you load the siunitx package? – leandriis Jun 18 '18 at 13:51
• yes i have used siunitx – Sir Real Jun 18 '18 at 13:53
• @SirReal You don't have to define units: just \si{torr} will work. However, I'm wondering what version you have: could you check your log for the line where siunitx is loaded? – Joseph Wright Jun 18 '18 at 14:25
• @Joseph The Package is : siunitx 2017/11/26 v2.7k A comprehensive (SI) units package – Sir Real Jun 18 '18 at 14:38