longtable
provides\\*
which can prevent the pagebreak,and.longtable
redefines\hline
to support this function- Then,
multirow
enhances\cline
to support that function.
One can use package option "longtable" to load the enhancement, seetexdoc multirow
, sec. 3.6. - It seems that
\hhline
fromhhline
package does not work with\\*
.
Is there a way to make hhline
work with \\*
? Maybe this answer can be a start point, but I am not sure.
\documentclass{article}
\usepackage{array}
\usepackage{longtable}
\usepackage[longtable]{multirow}
\usepackage{hhline}
\usepackage[table]{xcolor}
\textheight4\baselineskip
\pdfpageheight5\textheight
\begin{document}
\begin{longtable}{*{3}{|l}|}
\hline
A & B & C \\ \hline
A & B & C \\ \hline
A & B & C \\* \cline{2-3}
A & \cellcolor{pink}B & C \\* \cline{2-3}
A & B & C \\ \hline
\end{longtable}
\newpage
\begin{longtable}{*{3}{|l}|}
\hline
A & B & C \\ \hline
A & B & C \\ \hline
A & B & C \\* \hhline{|~|-|-|}
A & \cellcolor{pink}B & C \\* \hhline{|~|-|-|}
A & B & C \\ \hline
\end{longtable}
\end{document}
I need to use \cellcolor
inside a longtable
hence \hhline
seems to be a must, by texdoc colortbl
, sec. 10.
\\*
does not prevent page breaks at a following `\hlinemultirow
actually make\cline
working with\\*
, as stated in its package doc?