mkdocs-with-pdf icon indicating copy to clipboard operation
mkdocs-with-pdf copied to clipboard

rows lost after the pdf is generated

Open sushuai opened this issue 5 years ago • 2 comments

Hello, if the table row data is too much, some rows will be lost after the PDF is generated

sushuai avatar Sep 28 '20 06:09 sushuai

Thank you for your report.

I think this problem is due to WeasyPrint.

https://github.com/Kozea/WeasyPrint/issues/36 https://github.com/zhaoterryy/mkdocs-pdf-export-plugin/issues/50

Try adding the following css:

@media print {
  table,
  .md-typeset table:not([class]) {
    width: 100%;
    overflow-wrap: break-word;
    table-layout: fixed
  }

  th, td {
    word-break: break-all;
  }
}

orzih avatar Oct 01 '20 18:10 orzih

it didn't work for me with above css but rather but the one proposed in mkdocs-pdf-export-plugin issue :

@media print {
  .md-typeset table:not([class]) {
      display: block;
      border: none;
  }  
}

but the problem in WeasyPrint remains: long table is forced to start on a new page, often letting a title alone..

makayabou avatar Dec 27 '20 00:12 makayabou