2

when compiling it gave me this error:

! LaTeX Error: Something's wrong--perhaps a missing \item.

my code :

\scalebox{0.8}{\begin{table}[]
\begin{tabular}{|l|l|l|}
\hline
                                                                          & Actions de mise en conformité à réaliser & \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}Actions de\\ sensibilisation à\\ destination de\\ l’ensemble des\\ collaborateurs\\ sur des\\ thématiques\\ générales et\\ spécialisées\end{tabular}} \\ \cline{1-2}
\begin{tabular}[c]{@{}l@{}}Tâches à réaliser à\\ court terme\end{tabular} &      [courtTerme]                                &                                                                                                                                                                                                  \\ \cline{1-2}
\begin{tabular}[c]{@{}l@{}}Tâches à réaliser à\\ moyen terme\end{tabular} &       [moyenTerm]                                &                                                                                                                                                                                                  \\ \cline{1-2}
\begin{tabular}[c]{@{}l@{}}Tâches à réaliser à long\\ terme\end{tabular}  &       [longTerm]                                 &                                                                                                                                                                                                  \\ \hline
\end{tabular}
\end{table}}

it's a 3x4 table with the last column merge Can't figure why


Addendum: If the \scalebox directive is made to encase the tabular environment rather than the table environment, and if the multirow, babel, and fontenc packages are loaded with suitable options, the result is as in the following screenshot:

enter image description here

What should I do to keep the contents of the third column contained with the table?

Mico
  • 506,678
  • 1
    you should always show a complete example, which can be compile. But you should never put a table environment inside a box or another environment. – Ulrike Fischer Sep 21 '21 at 18:50
  • You want to make this table fit somehow. See My table doesn't fit; what are my options? (possible duplicate) – Werner Sep 21 '21 at 19:08
  • I've taken the liberty of posting an addendum, in which the \scalebox directive is made to encase the tabular environment rather than the table environment. (The result is a table in which the contents of the third column exceed the space available to them.) Feel free to revert. – Mico Sep 21 '21 at 19:52
  • surely you must have had an earlier not in outer par mode error from \scalebox{0.8}{\begin{table}[ ? you can not have a table environment in a box. – David Carlisle Sep 21 '21 at 21:54

1 Answers1

2

I wouldn't use the \scalebox sledgehammer, I wouldn't use multirow, and I wouldn't break the lines within various cells by hand. Instead, I'd use nested tabular environments and let LaTeX take care of the tedious line-breaking job.

enter image description here

I chose the width of the right-hand column (2.5cm) to make its overall height roughly equal to the heights of the other two columns.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{array,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}

\begin{document} \begin{table} \setlength\extrarowheight{2pt} % for a less cramped look \centering \begin{tabular}{@{} c @{}| P{2.5cm}|} \hline \begin{tabular}[t]{|P{3cm}|P{3.5cm}} & Actions de mise en conformité à réaliser \ \hline Tâches à réaliser à court terme & [courtTerme] \ \hline Tâches à réaliser à moyen terme & [moyenTerm] \ \hline Tâches à réaliser à long terme & [longTerm] \end{tabular} & Actions de sensibilisation à destination de l’ensemble des collaborateurs sur des thématiques générales et spécialisées \ \hline \end{tabular} \end{table} \end{document}

Mico
  • 506,678