複数行の最後の列の部分的な動作が不適切

複数行の最後の列の部分的な動作が不適切

ここドキュメント\multirow(答えが見つからなかった場所)と私の MWE は次のとおりです(ただし、意図したとおりに動作せず、問題を示しています):

\documentclass[twoside,a4paper,11pt,chapterprefix=true]{scrbook}

\usepackage[UTF8]{inputenc} %encodage clavier
\usepackage[T1]{fontenc} %encodage police
\usepackage[francais]{babel} %langue
\usepackage{multirow}

\begin{document}
\begin{tabular}{|c|c|c|c|}
\hline      
    \multicolumn{4}{|c|}{my little 1rst line} \\
\hline  
    \multicolumn{2}{|c|}{blabla}    & \multicolumn{2}{c|}{blabla} \\
\hline  
    blabla & blabla & \multirow{2}{*}{whaou there is so much text here, that's embarassing, look the cell goes beyond the tabular, and even beyond the page, the worst being : you don't even get a warning for going out of the page, and i'm not even talking about the margins...} \\
\cline{1-2} 
    \multicolumn{2}{|c|}{blabla} & \\
\hline  
\end{tabular}
\end{document}

私が望む動作は、セルを引き伸ばしたり、セル内に改行を強制したりして、セルを超えないようにすることです。

答え1

*in を使用すると\multirow、セルの幅はその内容の幅になります。代わりに、2 番目の引数で固定の適切な長さを使用することもできます。

\documentclass[twoside,a4paper,11pt,chapterprefix=true]{scrbook}
\usepackage[utf8]{inputenc} %encodage clavier
\usepackage[T1]{fontenc} %encodage police
\usepackage[francais]{babel} %langue
\usepackage{multirow}
\usepackage{array}

\begin{document}
\noindent\begin{tabular}{|c|c|c|c|}
\hline      
    \multicolumn{4}{|c|}{my little 1rst line} \\
\hline  
    \multicolumn{2}{|c|}{blabla}    & \multicolumn{2}{>{\centering\arraybackslash}p{5cm}|}{blabla} \\
\hline  
    blabla & blabla & \multirow{2}{5cm}{whaou there is so much text here, that's embarassing} \\
\cline{1-2} 
    \multicolumn{2}{|c|}{blabla} & \\
\hline  
\end{tabular}
\end{document}

ここに画像の説明を入力してください

もちろん、テーブルの実際の内容に応じて、列の仕様が変わる可能性があります (テキストの折り返しが必要な場合は、p{<length>}列を使用することをお勧めします)。

関連情報