3

In this table the horizontal lines, due to the \multicolumn command, do not fill the whole table.

One solution is to put extra horizontal space, as in the line with comment.
Is there another way (less trial and error) to do that? Thank you.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[version=3]{mhchem} 
\usepackage{siunitx,booktabs}
\begin{document}

\begin{tabular}{l|cccccc}
\toprule
 & \ce{COCl2(g)} & \ce{<-->} & \ce{CO(g)} & + & \ce{Cl2(g)} \\ 
\midrule 
inizio & 1 &  &  &  & \\ [1mm]
equilibrio &  $1 - \alpha$ &  &  $\alpha$ &  & $\alpha$ \\ [1mm]
moli totali & \multicolumn{6}{l}{$1 - \alpha + \alpha + \alpha = 1 + \alpha$} \\ [1mm]
%moli totali & \multicolumn{6}{l}{$1 - \alpha + \alpha + \alpha = 1 + \alpha\hspace{56mm}$} \\ [1mm]
frazioni molari & $\dfrac{1-\alpha}{1+\alpha}$ & & $\dfrac{\alpha}{1+\alpha}$ & & $\dfrac{\alpha}{1+\alpha}$ \\ [3mm]
pressioni parziali & $\left( \dfrac{1-\alpha}{1+\alpha}\right)P$ & & $\left( \dfrac{\alpha}{1+\alpha}\right) P$ & & $\left( \dfrac{\alpha}{1+\alpha}\right) P$ \\ [1mm]
\bottomrule 
\end{tabular}

\end{document}
1
  • Hmmm... there is a missing & in the line with inizio.
    – Rmano
    Jun 8, 2017 at 15:15

1 Answer 1

3

You need only 6 columns, so remove one c from the column specification. Also, since all the columns 2-6 are in math mode, spare these $s by adding >{$}c<{$} in the column specification.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[version=3]{mhchem} 
\usepackage{siunitx,booktabs,array}
\begin{document}

\begin{tabular}{l*5{>{$}c<{$}}}
\toprule
& \ce{COCl2(g)} & \ce{<-->} & \ce{CO(g)} & + & \ce{Cl2(g)} \\ 
\midrule 
inizio & 1 &  &  &  & \\ [1mm]
equilibrio & 1 - \alpha &  &  \alpha &  & \alpha \\ [1mm]
moli totali & \multicolumn{5}{l}{$1-\alpha+\alpha+\alpha = 1+\alpha$} \\ [1mm]
frazioni molari & \dfrac{1-\alpha}{1+\alpha} & & \dfrac{\alpha}{1+\alpha} & & \dfrac{\alpha}{1+\alpha} \\ [3mm]
pressioni parziali & \left(\dfrac{1-\alpha}{1+\alpha}\right)P & & \left(\dfrac{\alpha}{1+\alpha}\right) P & & \left(\dfrac{\alpha}{1+\alpha}\right)P \\ [1mm]
\bottomrule 
\end{tabular}

\end{document}

enter image description here

2
  • Yes... or a c more in the tabular. ;-)
    – Rmano
    Jun 8, 2017 at 15:33
  • A "c" more in the tabular from a previous reaction with two reagents! Jun 9, 2017 at 16:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .