i'm having an issue with a table that spans multiple pages and breaks across columns that span several rows. my code is listed below. the problem is that on page 1, row 1 shows up with foo1, bar1 and yikes1 with no problem. row 2 and foo2 also shows up on page 1 and then the page breaks, with bar2 and yikes2 ending up on page 2. i want it to break so that all of row 2 end up on the second page. the table will grow and shrink, so i'm hoping for a dynamic solution.
\begin {supertabular}{|p{1.0in}|p{3.0in}|m{1.10in}|m{1.25in}|}
\hline
col 1
& col 2
& col 3
& col 4
\\\hline
\multirow{4}{*}
row 1
& foo1
& bar1
& yikes1
\\\cline{2-4}
& foo1
& bar1
& yikes1
\\\cline{2-4}
& foo1
& bar1
& yikes1
\\\cline{2-4}
& foo1
& bar1
& yikes1
\\\cline{2-4}
\\\hline
\multirow{4}{*}
row 2
& foo2
& bar2
& yikes2
\\\cline{2-4}
& foo2
& bar2
& yikes2
\\\cline{2-4}
& foo2
& bar2
& yikes2
\\\cline{2-4}
& foo2
& bar2
& yikes2
\\\cline{2-4}
\\\hline
\end {supertabular}
Best Answer
This is very very similar to the question longtable multirow problem with cline and nopagebreak. You could also look there how to make a proper MWE ;-)
Compared to this, your code is lacking the following things:
\multirow
syntax wrong:\multirow{4}{*}{row 1}
looks better here.\multirow
. Using\\*
is a first step.\cline
. David gave a patch for this.With these things in mind, I made the following MWE:
But still I'm getting page breaks :-(
This seems to be a
supertabular
issue. On a first glance atsupertabular
s code, I couldn't find an obvious reason for this.After replacing
supertabular
bylongtable
everywhere, it works ;-)