2

I'm writing a tabular which is actually a form to print and be filled by hand. I want to set fixed column width. The problem comes when I try to merge columns in two different patterns.
I can't draw the table in Markdown, so I'll describe it. It's a 4 columns x 5 rows table. In the first two rows I want to merge the second and third columns, in the last three rows I want to merge the first with the second column and the third with the fourth column. But what I get is the second, third and fourth columns merged in the last three rows (I get the first two rows exactly as I want them).

I wrote this code

\documentclass{article}
\usepackage{multirow}
\begin{document}
\noindent\begin{tabular}{ | p{52mm}  p{21mm}  p{32mm}  p{41mm} | }
\hline
Nome e cognome & \multicolumn{2}{|l|}{Luogo e data di nascita} & Comune di iscrizione nelle liste \\
 & \multicolumn{2}{|l|}{}& Trezzano sul Naviglio \\
\hline
\multicolumn{2}{|l|}{Firma} & \multicolumn{2}{|l|}{Documento}   \\
\multicolumn{2}{|l|}{} & \multicolumn{2}{|l|}{}  \\
\multicolumn{2}{|l|}{} & \multicolumn{2}{|l|}{}  \\
\hline
\end{tabular}
\end{document}

How can I fix my code to get what I want?

2
  • Welcome to TeX.SE!
    – Mensch
    Commented Mar 30 at 12:02
  • Welcome to the site. Normally the best way to show a problem is to take a screenshot of the output, in cases like yours. Also please add a tag like tabular.
    – yannisl
    Commented Mar 30 at 13:17

1 Answer 1

3

The problem is, you never use any of the original columns, so apparently tabular forgets about these widths. So you would have to specify at least once the width of the merged columns in the third or a subsequent row. I guess you also would like to have some \hlines between the rows.

And you probably need some wider paper to fit the table.

\documentclass{article}
\usepackage{multirow}
\begin{document}
\noindent\begin{tabular}{ | p{52mm}  p{21mm}  p{32mm}  p{41mm} | }
\hline
Nome e cognome & \multicolumn{2}{|l|}{Luogo e data di nascita} & Comune di iscrizione nelle liste \\
 & \multicolumn{2}{|l|}{}& Trezzano sul Naviglio \\
\hline
\multicolumn{2}{|p{73mm}|}{Firma} & \multicolumn{2}{l|}{Documento}   \\
\hline
\multicolumn{2}{|l|}{} & \multicolumn{2}{l|}{}  \\ 
\hline
\multicolumn{2}{|l|}{} & \multicolumn{2}{l|}{}  \\
\hline
\end{tabular}
\end{document}

enter image description here

0

You must log in to answer this question.

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