1

I've a problem with a tabular. Here the MVE:

\documentclass[A4,11pt,twoside]{book}
\usepackage[T1]{fontenc}

\begin{tabular}{l|l|l|c|c|c|c}
\hline\hline
\multicolumn{4}{c}{\textbf{Livello Istruzione}}\\
\hline
\multicolumn{2}{c}{\textbf{Fascia 1}} & \multicolumn{2}{c}{\textbf{Fascia 2}} & \multicolumn{2}{c}{\textbf{Fascia 3}} & \multicolumn{2}{c}{\textbf{Fascia 4}}\\
\hline
\multicolumn{1}{c}{\textbf{BdM}} & \multicolumn{1}{c}{\textbf{BTV}} & \multicolumn{1}{c}{\textbf{BdM}} & \multicolumn{1}{c}{\textbf{BTV}} & \multicolumn{1}{c}{\textbf{BdM}} & \multicolumn{1}{c}{\textbf{BTV}} & \multicolumn{1}{c}{\textbf{BdM}} & \multicolumn{1}{c}{\textbf{BTV}}\\
\hline
30\% & 40\% & 2\%\\
20\% & 25\%\\
\hline\hline
\end{tabular}

I want a tabular like this:

enter image description here

but latex says "Error: extra allignement..."

Thank you for help!

migrated from tex.meta.stackexchange.com Sep 21 '16 at 19:21

This question came from our discussion, support, and feature requests site for users of TeX, LaTeX, ConTeXt, and related typesetting systems.

1

If you really want to create the look of the table shown in your screenshot, you should use the l column type for all 8 columns of the tabular environment. (The code you posted features a mixture of l and c cells.)

In the header cells, you appear to want to center rather than left-align the cell contents. In the second argument of \multicolumn, be sure to specify whether or not | ("vertical bar") should appear at the left- or right-hand edges of the column.

enter image description here

\documentclass[a4paper,11pt,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\begin{document}
\begin{tabular}{|*{8}{l|}}
\hline
\multicolumn{8}{|c|}{} \\
\multicolumn{8}{|c|}{\textbf{Livello Istruzione}}\\
\multicolumn{8}{|c|}{} \\
\hline
\multicolumn{2}{|c|}{\textbf{Fascia 1}} & 
\multicolumn{2}{c|}{\textbf{Fascia 2}}  & 
\multicolumn{2}{c|}{\textbf{Fascia 3}}  & 
\multicolumn{2}{c|}{\textbf{Fascia 4}}  \\
\hline
\multicolumn{1}{|c|}{\textbf{BdM}} & \multicolumn{1}{c|}{\textbf{BTV}}  & 
\multicolumn{1}{c|}{\textbf{BdM}}  & \multicolumn{1}{c|}{\textbf{BTV}}  & 
\multicolumn{1}{c|}{\textbf{BdM}}  & \multicolumn{1}{c|}{\textbf{BTV}}  & 
\multicolumn{1}{c|}{\textbf{BdM}}  & \multicolumn{1}{c|}{\textbf{BTV}}  \\
\hline
30\% & 40\% & 2\% & & & & & \\
20\% & 25\% &     & & & & & \\
\hline
\end{tabular}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.