# Math Help - Columns width under multicolumn

1. ## Columns width under multicolumn

Good afternoon everybody,

I am a begineer in Latex and I have some trouble setting column's width in a Latex document. I have double columns under which I would like the columns to be split evenly (50% of the double column each) but I juste don't understant how to get this result. Here is a sample of what I get. (hope my explanation of what I want is clear enough).

$
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}
& 0,\Omega & 1,\Omega & 0,\Omega & 1,\Omega & 0,\Omega & 1,\Omega \\ \hline
\end{tabular}$

2. Originally Posted by asfd
Good afternoon everybody,

I am a begineer in Latex and I have some trouble setting column's width in a Latex document. I have double columns under which I would like the columns to be split evenly (50% of the double column each) but I juste don't understant how to get this result. Here is a sample of what I get. (hope my explanation of what I want is clear enough).

$
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}
& 0,\Omega & 1,\Omega & 0,\Omega & 1,\Omega & 0,\Omega & 1,\Omega \\ \hline
\end{tabular}$

This may be of use to you.

3. Originally Posted by asfd
Good afternoon everybody,

I am a begineer in Latex and I have some trouble setting column's width in a Latex document. I have double columns under which I would like the columns to be split evenly (50% of the double column each) but I juste don't understant how to get this result. Here is a sample of what I get. (hope my explanation of what I want is clear enough).

$
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}
& 0,\Omega & 1,\Omega & 0,\Omega & 1,\Omega & 0,\Omega & 1,\Omega \\ \hline
\end{tabular}$

The LaTeX tabular environment really isn't very helpful if you want to control widths of columns. The only way I know to get columns of equal width is to replace the "c" declaration in the table specification by something like "p{3em}". That will give a column of the specified width, but it will not be centred. However, you can then centre each individual table entry by padding it with flexible space in the form of an \hfil before and after it.
Code:
\begin{tabular}
{|c|p{3em}|p{3em}|p{3em}|p{3em}|p{3em}|p{3em}|}
\hline
& \multicolumn{2}{c|}{Linear Elements}
& \multicolumn{2}{c|}{Cubic Elements} \\
\cline{2-7}
&\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil
&\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil
&\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil \\
\hline
\end{tabular}
$\begin{tabular}{|c|p{3em}|p{3em}|p{3em}|p{3em}|p{3 em}|p{3em}|}
\hline
& \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}
&\hfil 0,\Omega\hfil &\hfil 1,\Omega\hfil &\hfil 0,\Omega\hfil &\hfil 1,\Omega\hfil &\hfil 0,\Omega\hfil &\hfil 1,\Omega\hfil \\ \hline
\end{tabular}$

Laborious and inelegant, but it should give you the desired result.

4. Originally Posted by Opalg
Laborious and inelegant, but it should give you the desired result.
Thanks a lot! Your last sentence pretty much says it all.