LaTeX の長い表の 2 つのセル間の垂直線を削除する

LaTeX の長い表の 2 つのセル間の垂直線を削除する

私は LaTeX でこのコードを使用して表を作成します:

\begin{center}
\begin{longtable}{|c|p{0.08\linewidth}|p{0.08\linewidth}|}
    \hline
    \multirow{3}{*}{Text O}
    & \multicolumn{2}{c|}{\multirow{2}{*}{Text S}}\\
    &&\\
    \cline{2-3}
    &P&P\\ \hline
    1&2&3\\ \hline
    4&5&6\\ \hline
 \end{longtable}
 \end{center}

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

列 2 と 3 の間の縦線 (テキスト S セルの縦線) を消去するにはどうすればよいですか?

ありがとう :)

答え1

書式を修正する方法の1つは、行を置き換えることです。

&&\\

& \multicolumn{2}{c|}{} \\

&つまり、2 番目のシンボルを に置き換えます\multicolumn{2}{c|}{}


完全な最小限の動作例ムウェは、(a) 不要で逆効果なラッパーを取り除きcenter、(b) 指示を使用して\endhead資料\endlastfootに何らかの構造を与えますlongtable

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

\documentclass{article} % or some other suitable document class
\usepackage{longtable,multirow}

\begin{document}

\begin{longtable}{ | c | *{2}{p{0.08\linewidth}|} }

% table header
    \hline
    \multirow{3}{*}{Text O}
      & \multicolumn{2}{c|}{\multirow{2}{*}{Text S}} \\
      & \multicolumn{2}{c|}{} \\ \cline{2-3}
      & P & P \\ \hline
    \endhead

    \hline
    \endlastfoot
      
% body of table

    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\ 

\end{longtable}

\end{document}

関連情報