2

I need to create this table:

target

I'm having problems on the second row, this is what I got:

current

I'm not understanding where I'm wrong

\documentclass[11pt]{report}
\usepackage{outline} \usepackage{pmgraph} \usepackage[normalem]{ulem}
\usepackage{graphicx} \usepackage{verbatim}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{multirow}
\begin{document}
\begin{tabular}[t]{|p{2cm}|p{3cm}|p{2.8cm}|p{5.1cm}|p{1.1cm}|p{0.2cm}|}

\hline
\textbf{Requisito}  &   R1 & \textbf{Tipo Requisito}  &   Funzionale &     \textbf{Casi d'uso} & 1\\
\cline{1-6}
\hline
\textbf{Descrizione} &
 \multicolumn{3}{|c|}{\multirow{2}{2cm}{L’utente inserisce le  informazioni relative alla propria forma fisica, alle preferenze relative alle letture tematiche e alla privacy}}
\textbf{Descrizione} & bbb  &   bbbb\\
\cline{1-6}


\textbf{Razionale}  &  cc  &  ccc  &   cccc\\
\cline{1-6}

\textbf{Attore innescante}  &  dd   &  ddd  &   dddd\\
\cline{1-6}
\hline
\end{tabular}
\end{document}
5
  • Please provide a compileable code. Nov 28, 2015 at 12:07
  • Welcome to TeX.SX! Please do not post fragments only, but a full document around this, i.e. with \documentclass{...}, the relevant packages and \begin{document}...\end{document}. On first glance: \multirow is wrongly used, but this is untested by me
    – user31729
    Nov 28, 2015 at 12:08
  • Why did you edit my image uploadings away? :-(
    – user31729
    Nov 28, 2015 at 12:12
  • sorry, i was editing with the full code :( @ChristianHupfer
    – Mark
    Nov 28, 2015 at 12:13
  • For multirow, you have to (1) add sufficient rows to make space and (2) leave the cells in those rows empty. 2 rows is not enough and you have not left the cells empty, either. Not with a width of only 2cm, anyway.
    – cfr
    Nov 28, 2015 at 12:39

2 Answers 2

1

Please see the following MWE:

\documentclass[11pt]{report}
%\usepackage{outline} \usepackage{pmgraph} \usepackage[normalem]{ulem}
%\usepackage{graphicx} \usepackage{verbatim}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multirow}


\begin{document}
\begin{tabular}[t]{|p{2cm}|p{2cm}|p{2.8cm}|p{4.1cm}|p{1.1cm}|p{0.2cm}|}

\hline
\textbf{Requisito}   &   R1 & \textbf{Tipo Requisito}  &   Funzionale &     \textbf{Casi d'uso} & 1\\
\cline{1-6}
%\hline
\textbf{Descrizione} &
 \multicolumn{5}{|p{10.2cm}|}{L’utente inserisce le  informazioni relative alla propria forma fisica, alle preferenze relative alle letture tematiche e alla privacy}\\
\cline{1-6}
\textbf{Descrizione} & bbb  &   bbbb                   &              &                         & \\
\cline{1-6}
\textbf{Razionale}   &  cc  &  ccc                     &   cccc       &                         & \\
\cline{1-6}
\textbf{Attore innescante} & &  dd                     &  ddd         &   dddd                  & \\
\hline
\end{tabular}
\end{document}

If you want to have one cell over 5 columns you have to use \multicolumn{5}{...}. Your columns are too wide. I reduced some sizes to place the table visable on the paper. Please work on this. And at last you missed several &, because even if a cell is empty you have to write it. It is easier to see missing & if you pretty print your table. See my code please.

At last you should get rid of the vertical lines. And better use package booktabs (texdoc booktabs on your terminal for the documentation).

with the result:

enter image description here

2
  • You need to allow for the separation between columns in figuring the width for the multicolumn else it will get cut off oddly on the right like that.
    – cfr
    Nov 28, 2015 at 12:54
  • Ok it's almost perfect, I've edited it and I need just one more thing, in the last row of the first column I would have the word "innescante" all under attore, how I can do it?
    – Mark
    Nov 28, 2015 at 13:05
0

Do you need somthing like this?

\begin{tabular} [t]{|p{2cm}|p{3cm}|p{2.8cm}|p{3.1cm}|p{1.1cm}|p{0.2cm}|}
\hline
\textbf{Requisito}  &   R1 & \textbf{Tipo Requisito}  &   Funzionale &     \textbf{Casi d'uso} & 1\\
\cline{1-6}
\hline
\textbf{Descrizione} & 
\multicolumn{5}{|p{\linewidth}|}{L’utente inserisce le  informazioni relative alla propria forma fisica, alle preferenze relative alle letture tematiche e alla privacy}&\\
\hline
\textbf{Descrizione} & bbb  &   bbbb & bbb & bb &\\
\hline
\end{tabular}

enter image description here

3
  • Maybe 5 rather than 4 in the multicolumn?
    – cfr
    Nov 28, 2015 at 12:54
  • yes, there must be \multicolumn{5}{|p{\linewidth}|}
    – Viktor
    Nov 28, 2015 at 13:29
  • I made correction
    – Viktor
    Nov 28, 2015 at 13:51

You must log in to answer this question.

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