View Single Post
Old 12-18-2022, 05:42 AM   #1
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 1,029
Karma: 2003162
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
Struggling with table page breaks

I have on my kobo an ebook with the following table definition:
Code:
table {
  border: none;
  table-layout: auto;
  width: 100%;
  line-height: normal;
}
tr {
  page-break-inside: avoid;
  page-break-after: auto;
}
td {
  padding: 2px;
  border: none;
}
I have the following ebook text entry:

Code:
<body>
  <p>Some text</p>
  /* unwanted page break occurs here */
  <table>
    <tbody>
      <tr>
        <td>column1</td>
        <td>column2</td>
      </tr>
    [...]
      <tr>
        <td>column1</td>
        <td>column2</td>
      </tr>
    <tbody/>
  </table>
</body>
Unfortunately, even when the text paragraph contains little text, and the page has ample space, the table always starts at a new (next) page, even when I add "page-break-before: avoid" in the table definition.
How can I avoid this unwanted page break on a kobo device?
DrChiper is offline   Reply With Quote