<script language="javascript"> function printTable(obj) { var winname = window.open('', "_blank", 'toolbar=no,menubar=yes,scrollbars=yes, resizable=yes,location=no, status=yes'); winname.document.open('text/html', 'replace'); winname.document.writeln(obj.outerHTML); winname.document.close(); } function printTableById(tableid) { var tb = document.getElementById(tableid); if(tb == null) alert('Can not found the table you want to print /n (table id is ' + tableid + ')'); else printTable(tb); document.close(); } </script>
<script language="javascript">
function printTable(obj)
{
var winname = window.open('', "_blank", 'toolbar=no,menubar=yes,scrollbars=yes, resizable=yes,location=no, status=yes');
winname.document.open('text/html', 'replace');
winname.document.writeln(obj.outerHTML);
winname.document.close();
}
function printTableById(tableid)
{
var tb = document.getElementById(tableid);
if(tb == null)
alert('Can not found the table you want to print /n (table id is ' + tableid + ')');
else
printTable(tb);
document.close();
}
</script>
Show how to print a table in a html page
Table Title | |||||
Row 1 - Column1 | Row 1 - Column2 | ||||
Empty here |
|
<script language="javascript">
function printTable(obj)
{
var winname = window.open('', "_blank", 'toolbar=no,menubar=yes,scrollbars=yes, resizable=yes,location=no, status=yes');
winname.document.open('text/html', 'replace');
winname.document.writeln(obj.outerHTML);
winname.document.close();
}
function printTableById(tableid)
{
var tb = document.getElementById(tableid);
if(tb == null)
alert('Can not found the table you want to print /n (table id is ' + tableid + ')');
else
printTable(tb);
document.close();
}
</script>