I'm maintaining an existing website and I have a document that needs to be printed .
I have made some updates to correct some things on the document but the document is made to be printed from a different window. I was wondering both how to make sure the inner html fits inside a browser window and prints inside an 8 1/2 X 11 sheet of paper. Right now it bleeds off the paper and when printed stretches off of the paper worse.
The inner html is just an 870px wide html table yet even reducing the width to 800px does not change how it displays in the window or prints. The printable version is a popup done by injecting a javscript click event by changing a label's .text()
property to
JS
function printClick() {
var w = window.open();
var html = $("#prntrForm").html();
html.style.width = '92%';
$(w.document.body).html(html);
}
$(function() {
$("a#print").click(printClick);
});
HTML
<a href="#"id="print">Printer Form</a>
Anyway I really just need to know how to size the width of the contents of the new window, making the new window have a print function would also be nice but isn't necessary. The similar questions I found seem to point to changing the css but I haven't added a css.