Skip to content

Instantly share code, notes, and snippets.

@lovelock
Created December 28, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lovelock/70b76ef8db5b8a2d9c3fbd9f2975523f to your computer and use it in GitHub Desktop.
Save lovelock/70b76ef8db5b8a2d9c3fbd9f2975523f to your computer and use it in GitHub Desktop.
css to solve wkhtmltopdf long and wide table
thead {
display: table-row-group;
}
.markdown-body table {
overflow: hidden !important;
word-wrap: break-word !important;
word-break: break-all;
}
.markdown-body td {
min-width: 80px;
}
.markdown-body tr {
page-break-before: always !important;
page-break-after: always !important;
page-break-inside: avoid !important;
}
.markdown-body pre code {
overflow: hidden !important;
word-wrap: break-word !important;
}
@lovelock
Copy link
Author

maybe the !important is not necessary, you can try it

@susajsnair
Copy link

i don't think it will restrict page breaking in table rows. i am still facing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment