Here is the code;
[HTML]
<head>
<script>
function printpreview()
{
var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 8 - page setup (for printing)
* 1 - open window
* 4 - Save As
* 10 - properties
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
<table id="schedule" width="200" cellpadding="1" cellspacing="1" border="1">
<tr align="center">
<td width="50%">ID</td>
<td width="50%">Value</td>
</tr>
<tr align="center">
<td width="50%">1</td>
<td width="50%">OK</td>
</tr>
<tr align="center">
<td width="50%">2</td>
<td width="50%">OK</td>
</tr>
</table>
<input name="Print" type="button" value="Print Preview" onclick="printpreview();" />
</body>
</html>
[/HTML]
How can i preview the table only not all the page?
I've tried this but not running;
document.getElementById('schedule').insertAdjacent HTML('beforeEnd', WebBrowser);