I just want to make sure that you've already explored the CSS alternative - which allows us to view content in one way on the screen, and another on paper.
We can use the CSS meida rules to handle this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html
<html>
<head>
<title></title>
<style type="text/css" media="screen">
#maindiv
{
width:648px;
}
</style>
<style type="text/css" media="print">
#maindiv
{
width:100%;
}
</style>
</head>
<body>
<div id="maindiv">
<table width="100%">
<tr>
<td>This table will display at 648 pixels wide, but print at 100% of the width of a printed page.</td>
</tr>
</table>
</div>
</body>
</html>
Some documentation:
http://www.w3.org/TR/CSS21
and
http://www.w3.org/TR/CSS21
It's hard to tell from your comment what else is going on in your page, so understand that this was a very basic example...
Main Topics
Browse All Topics





by: COBOLdinosaurPosted on 2004-05-24 at 12:01:09ID: 11145762
Pixels do not map to printers which use points. There is no way to set up tables to guarantee they will print the same for all users. Margins are controlled by the user preferences. You can play around with dimensions, and get it to print right FOR ONE SETUP, but unless you have a certainty the every user will be using the same printer, driver, and browser; with identical preference settings there is no way of insuring correct printing.
riptx/inde x.asp
If the print quality is critical then you need to either use a print friendly format like pdf or do the fromatting with activeX like: http://www.meadroid.com/sc
However using Activex has security issues and some users will not permit it on there computers, and firewalls may be configured to block it. You mention IE6 specifically, so that sounds like this is on an intranet. In that case the activeX solution becomes more viable.
Cd&