In Longtable, in Multirow größer als \textwidth

In Longtable, in Multirow größer als \textwidth

MWE

\documentclass[a4paper,12pt]{book}

\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}

\usepackage{array} 
\usepackage{longtable} 
\usepackage{showframe} 
\usepackage{multicol}
\usepackage{multirow}

\begin{document}

textwidth = 2.1cm + 2.8cm + 2.8cm + 2cm = 9.7cm

\begin{longtable}{|p{2.1cm}| p{2.8cm} |p{2.8cm}|p{2cm}|}
\hline
\multicolumn{4}{|c|}{\textbf{Q CODES}} \\
\hline
\textbf{Q CODE} & \multicolumn{3}{c|}{\textbf{EXPLAIN}} \\
\hline
\multirow{6}{*}{QOD} & \multicolumn{3}{l|}{Short Sentence, No Problem ( 9.7cm )}\\
                 & \multicolumn{3}{l|}{Long Sentence, Long Sentence, Long Sentence Problem ( greater than 9.7cm )}\\
                 \cline{2-4}
                 & 0 Holland & 1 English & 2 France\\
                 & 3 Germany & 4 Greece & 5 Italia\\
                 & 6 Japan & 7 Norvia & 8 Russia\\
                 & 9 Espanol  & &\\ 
\hline
\end{longtable}
\end{document}

Anzeige, Bildbeschreibung hier eingeben.

Mein Problem: Lange Sätze in Longtable in Multirow gehen nicht in die nächste Zeile. Das heißt, die Zeile ist größer als \textwidth. Was mache ich mit der Zeile, die gleich ist \textwidth? (Vielleicht wäre die Antwort einfach. Aber ich finde sie nicht.)

Antwort1

Verwenden Sie die Parbox innerhalb mehrerer Spalten (das Hinzufügen von 3 Spalten ergibt 7,6 cm) wie folgt:

 \documentclass[a4paper,12pt]{book}

 \usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}

\usepackage{array} 
\usepackage{longtable} 
\usepackage{showframe} 
\usepackage{multicol}
\usepackage{multirow}

\begin{document}

textwidth = 2.1cm + 2.8cm + 2.8cm + 2cm = 9.7cm

\begin{longtable}{|p{2.1cm}| p{2.8cm} |p{2.8cm}|p{2cm}|}
\hline
\multicolumn{4}{|c|}{\textbf{Q CODES}} \\
\hline
\textbf{Q CODE} & \multicolumn{3}{c|}{\textbf{EXPLAIN}} \\
\hline
\multirow{6}{*}{QOD} & \multicolumn{3}{l|}{Short Sentence, No Problem ( 9.7cm )}\\
             & \multicolumn{3}{l|}{\parbox{7.6cm}{Long Sentence, Long     Sentence, Long Sentence Problem ( greater than 9.7cm )}}\\
             \cline{2-4}
             & 0 Holland & 1 English & 2 France\\
             & 3 Germany & 4 Greece & 5 Italia\\
             & 6 Japan & 7 Norvia & 8 Russia\\
             & 9 Espanol  & &\\ 
\hline
\end{longtable}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen