Document Object
This is an example of Javascript code to create a basic webpage with an inline stylesheet.
To code a backslash within a javascript statement such as in </H1> , proceed it with a forward slash as in the example below.
printWindow.document.write('<\/H1>');
Adding a newline(' \n' )will make the HTML more readable
printWindow.document.write('\n') ;
Note that there is no content between the BODY tags
var stats = 'toolbar=no,location=no,directories=no, status=yes, menubar=yes,scrollbars=yes,resizable=yes';
printWindow = window.open("","printwin",stats);
printWindow.document.write('<HTML>');
printWindow.document.write('\n');
printWindow.document.write('<HEAD>');
printWindow.document.write('\n');
printWindow.document.write('<TITLE>Display Table<\/TITLE>' );
printWindow.document.write('<STYLE>' );
printWindow.document.write('\n');
printWindow.document.write('TH {font: bold 12pt "Arial";color:navy} ');
printWindow.document.write('\n');
printWindow.document.write('TD {font: bold 10pt "Arial";color:blue} ');
printWindow.document.write('\n');
printWindow.document.write('<\/STYLE> <\/HEAD>');
printWindow.document.write('<BODY>');
printWindow.document.write('<\/BODY> <\/HTML>');
printWindow.document.close(); //close input to allow Printing of this window text rather than that of the parent window.
}// End of function printresults(title,records)