BaileyJM02 / markdown-to-pdf

A GitHub Action to make PDF and HTML files from Markdown
MIT License
129 stars 31 forks source link

Cut Off Tables in PDF - scaling #39

Open HannesWuensche opened 1 year ago

HannesWuensche commented 1 year ago

Dear @BaileyJM02 ,

Thank you for the Action! But i have run into a problem today:

I have quiet packed tables. In github they are rendered without a scroll bar, but in the PDF the table is cut off. Github: https://github.com/HannesWuensche/Readme2PDF PDF: https://github.com/HannesWuensche/Readme2PDF/blob/main/%5BDokumentation%5D_Readme2PDF.pdf

It would be nice to render the pdf on basis of the scaling of the single Readme.md view, since it is not so Packed. Readme View: https://github.com/HannesWuensche/Readme2PDF/blob/main/Readme.md

Or have a scaling option to reduce the overall font size. Is there a way to adjust scaling of the PDF output or tables within the pdf? THX Hannes

BaileyJM02 commented 1 year ago

Hey @HannesWuensche, I'll have to investigate this more as I agree it's a little strange. To fix this it might be possible to edit the CSS file and alter the font size / padding within tables?

Sp0ngy commented 10 months ago

I just ran into the same issue, here is my custom css file:

#table_resize.css
table {
    display: table;
}

table td,
table th {
  font-size: 12px;
  padding: 1px 3px;
}

with display: table all tables will be rendered for the whole width of the page. If you still have an overflow, you can work with font-size and padding.

@BaileyJM02: thanks for the action!