I need help with formatting a list of col-6
elements (bootstrap) inside a row
element so that the content of each block remains intact in a pdf preview generated using print()
. I attempted to use various css properties like page-break
and break
as suggested in this thread, but it didn't work as expected.
var dom = document.querySelector("#list");
dom.innerHTML = dom.innerHTML.repeat(6);
print();
#list>* {
padding: 20px;
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid;
page-break-after: always;
page-break-before: always;
break-after: page;
break-before: page;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="24464b4b50575056455464110a140a16">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="row" id="list">
<div class="col-6">
<p>
Content goes here...
</p>
<p>
More content here...
</p>
</div>
</div>