When printing in IE8, I'm facing an issue with keeping the "Table title" line on the same page as the <table>
.
Despite using page-break-inside:avoid;
, there is still a page break between the table title and the actual table. My expectation is for them to be kept together and pushed to the next page if necessary.
The provided HTML document uses XHTML 1.0 Transitional doctype, has
<meta http-equiv="X-UA-Compatible" content="IE=8" />
to force IE8 into Standards Mode, which is supposed to support this syntax (source). Rendering is confirmed to be done in standards mode by checking document.compatMode == "CSS1Compat"
. The XHTML is valid.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>Page title</title>
</head>
<body>
<h1>Page content</h1>
this is some content
<br />which<br />should<br />push<br />the<br />table<br />below<br />on<br />to<br />the<br />next<br />page<br />but<br />the<br />table<br />should<br />be<br />kept<br />together<br />if<br />at<br />all<br />possible<br />please!
<div style="page-break-inside:avoid;">
<p><strong>Table title which needs to be kept with the table</strong></p>
<table>
... (Table contents go here) ...
</table>
</div>
</body>
</html>