orzih / mkdocs-with-pdf

Generate a single PDF file from MkDocs repository.
MIT License
332 stars 77 forks source link

rows lost after the pdf is generated #23

Open sushuai opened 4 years ago

sushuai commented 4 years ago

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

orzih commented 4 years ago

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;
  }
}
makayabou commented 3 years ago

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..