Jump to content

CSS for printing table grid lines and prevent inside page break


pstein

Recommended Posts

Assume I have a HTML table like

 

<table>

...

</table>

 

1.) How can I define CSS for the table so that the inner grid lines are printed as well?

 

2.) How can I define CSS for the table so that the table is NOT split on two pages when printed?

If the table does not fit on one page it should start on top of the next print (pdf) page.

 

Peter

 

Link to comment
Share on other sites

As long as the <td> elements have borders the borders should show up when printed. You can specify a print stylesheet to make sure of it using @media print

You can prevent a table from breaking using the page-break-inside rule.

 

As in this example

@media print{p {page-break-inside:avoid;}}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...