OsakaWebbie
Programmer
I'm trying to lay out a table to print addresses on envelopes, and some of them (Japanese addresses) need to have the return address in the lower right corner as oriented in my table. I use valign=bottom for the cell with the return address. It looks right on the screen (as far as I can tell - it's hard to measure), but for some reason, when I print, even if I specify the table height in pixels, and even if I make one column span all the rows and put a one-pixel white gif in it with the height specified, the return address isn't as far down as it should be. And it's not my miscalculation of how tall it should be - I tried increasing the height even more, but the return address graphic doesn't move down. It seems that the printing algorithm decides that the table doesn't need to be that tall! It works if I type text in an unused cell, but naturally the height of several "p" lines is not consistent, so I can't just make the text white and leave it there (and perhaps if I make it white the printing algorithm will again try to think for me - I haven't tested that because I know it's unacceptable as a permanent solution). Any thoughts?
Here is my test code (ultimately it will be filled by PHP from a database, but I need to get the layout right first). I cleaned it up for the forum by replacing all Japanese text, including the name of the font I use. The reason it has to be so crazy (like each digit of the postal code in a separate cell, and the return address as a graphic) is because of how Japanese envelopes are expected to be addressed, and the limitations of doing that layout in HTML. Don't worry about that - just help me get the table to really print 495 pixels tall. Thanks!
<table border="0" cellpadding="0" cellspacing="0" style="page-break-before: always" width="916" height="495">
<tr height="42">
<td rowspan="9" width="117" valign="top" align="left" height="495"><img src="graphics/white_pixel.gif" alt="" height="495" width="117" border="0"></td>
<td width="98" valign="top" align="left" height="42"></td>
<td width="637" valign="top" align="left" height="42"></td>
<td width="64" valign="bottom" align="right" height="42"></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><b><font size="6" face="Japanese sideways font">7</font></b></td>
<td width="637" valign="top" align="left" height="33"></td>
<td bgcolor="white" width="64" valign="bottom" align="right" rowspan="8" height="451"><img border="0" src="return_address.gif" width="50" height="147"></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">6</font></td>
<td width="637" height="33"></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">5</font></td>
<td rowspan="6" align="left" valign="top" width="637" height="381"><b><font size="5" face="Japanese sideways font">First Address Line<br>
Second Address Line<br>
<br>
</font><font size="6" face="Japanese sideways font">Name</font></b></td>
</tr>
<tr height="51">
<td width="98" valign="top" align="left" height="51"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="188">
<td width="98" valign="top" align="left" height="188"></td>
</tr>
</table>
Here is my test code (ultimately it will be filled by PHP from a database, but I need to get the layout right first). I cleaned it up for the forum by replacing all Japanese text, including the name of the font I use. The reason it has to be so crazy (like each digit of the postal code in a separate cell, and the return address as a graphic) is because of how Japanese envelopes are expected to be addressed, and the limitations of doing that layout in HTML. Don't worry about that - just help me get the table to really print 495 pixels tall. Thanks!
<table border="0" cellpadding="0" cellspacing="0" style="page-break-before: always" width="916" height="495">
<tr height="42">
<td rowspan="9" width="117" valign="top" align="left" height="495"><img src="graphics/white_pixel.gif" alt="" height="495" width="117" border="0"></td>
<td width="98" valign="top" align="left" height="42"></td>
<td width="637" valign="top" align="left" height="42"></td>
<td width="64" valign="bottom" align="right" height="42"></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><b><font size="6" face="Japanese sideways font">7</font></b></td>
<td width="637" valign="top" align="left" height="33"></td>
<td bgcolor="white" width="64" valign="bottom" align="right" rowspan="8" height="451"><img border="0" src="return_address.gif" width="50" height="147"></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">6</font></td>
<td width="637" height="33"></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">5</font></td>
<td rowspan="6" align="left" valign="top" width="637" height="381"><b><font size="5" face="Japanese sideways font">First Address Line<br>
Second Address Line<br>
<br>
</font><font size="6" face="Japanese sideways font">Name</font></b></td>
</tr>
<tr height="51">
<td width="98" valign="top" align="left" height="51"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="33">
<td width="98" valign="top" align="left" height="33"><font size="6" face="Japanese sideways font">1</font></td>
</tr>
<tr height="188">
<td width="98" valign="top" align="left" height="188"></td>
</tr>
</table>