I have a \longtable
with \multirow
cells, as in the picture attached.
Here, if I try to break the line and there isn't enough space at the bottom of the page, the remaining part of the sentence goes outside of the table.
Same issue if I don't force any interruption but the sentence is quite long.
Do you think \pagebreak
is the only solution?
Note:
- I know that I'm giving a wrong number of lines to
\multirow
(i.e.\multirow[t]{5}{=}{item 1\newline pos. A}
instead of\multirow[t]{8}{=}{item 1\newline pos. A}
but I'm working with thousands of lines which will change in length in a future revision of the doc, so, for me, is easier to count the number of\square
(anyway, this seems to not be the cause of my issue).
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{pdflscape}
\renewcommand{\baselinestretch}{1.5}
\begin{document}
\begin{landscape}
\begin{longtable}{|p{4cm}|p{10cm}|p{4cm}|p{4cm}|}
\hline
COMPONENT & CHECKS DESCRIPTION & CHECKED – NOTE & CHECKED – NOTE\\
\hline
\endfirsthead
\hline
COMPONENT & CHECKS DESCRIPTION & CHECKED – NOTE & CHECKED – NOTE\\
\hline
\endhead
\hline
\endfoot
\hline
\endlastfoot
\multirow[t]{5}{=}{item 1\newline pos. A} & check this doing that text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
\hline
\multirow[t]{4}{=}{item 2\newline pos. B} & check this doing that text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
\hline
\multirow[t]{5}{=}{item 3\newline pos. C} & check this doing that text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
\hline
\multirow[t]{3}{=}{item 4\newline pos. D} & check this doing that text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
& check this doing that text text text text text text text text text text text text text & $\square\ldots$ & $\square\ldots$\\
\hline
\end{longtable}
\end{landscape}
\end{document}
\\*
instead of\\
whenever you want to prevet a pagebreak between the teo table rows.