I’m trying to get something like this:
---------------------------------
| Hello world | Again |
---------------------------------
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---------------------------------
So I wrote:
\begin{tabular}{l|l|l}
\multicolumn{4}{c}{Población total en millones}
\multicolumn{4}{c}{Porcentaje de población rural}\\
\hline
1975 & 2001 & 2003 & 2015 & 1975 & 2001 & 2003 & 2015\\
\hline
10,3 & 15,4 & 16 & 17,9 & 21,6 & 14 & 13 & 9,8
\end{tabular}
But it gives me this error:
! Misplaced \omit.
\multispan ->\omit
\@multispan
What can I do?
Edit
Also, how can I get a border between the two columns?
Thanks.
You need to have 8 columns set first, then span to it. 🙂
The spanned columns should also be separated by the
&alignment operator.To get the line in between the columns just modify the specifier:
More information on table formatting is over at WikiBooks. 🙂