...

View Full Version : Problem with tables



simwit
12-21-2002, 06:06 PM
If I enter the following code I cannot get the picture right aligned because of the text in the bottom row. If I remove the text, the picture is right aligned. How do I fix this problem while still maintaining the layout.

<html>
<body>
<table width=780 border="1" cellpadding="0" cellspacing="1">
<tr>
<td width="180" rowspan="3">blank</td>
<td colspan="2">blank</td>
<td width="102" rowspan="2"><img src="images/test.jpg" width="102" height="135" align="right"></td>
</tr>
<tr>
<td width="256">blank</td>
<td width="227">blank</td>
</tr>
<tr>
<td colspan="3">blankfr frefref erferf erfrefer fer fer fref erf er ferfreferf
erfrefrefrefer frrefrefre referferfre frerferfref rfrefrefref reiufheruf freiufhiuerhf fuerihfiurehif freifhreiuf fioerhfer fureiufh erfhiuerhfiuehriufhiuer fiuerhife ferfhre urefier</td>
</tr>
</table>
</body>
</html>

dreamingdigital
12-21-2002, 08:18 PM
Try this:

<td width="102" rowspan="2" align=right><img src="images/test.jpg" width="102" height="135"></td>

or this way

<p align=right>><img src="images/test.jpg" width="102" height="135"></p>

cp

simwit
12-21-2002, 08:28 PM
<td align="right" width="102" rowspan="2"><p align=right><img src="images/test.jpg" width="102" height="135" align="right"></p></td>

Tried all those methods. Still doesn't seem to work. It seems to lose it's alignment when the text in the bottom row overflows and word wraps. Any ideas?

dreamingdigital
12-21-2002, 09:09 PM
ok I see the real problem. You need to size your blank tables cells with spacer gifs in addition to using the width="" attribute on the <td>. I know this seems stupid but browsers really are stupid and you need to tell them exactly what to do. Sizing table cells with transparent gif's 1px tall by wide will fix your problem.

In photoshop create a new file with transparent background that is 1px by 1px. Then save for web with transparency turned on and chose gif. Name it clr.gif or spacer.gif or something. Now put it in your table to set the widths of your cells.

<html>
<body>
<table width=780 border="1" cellpadding="0" cellspacing="1">
<!-- table sizer row -->
<tr>
<td><img src="spacer.gif" width=180 height=1 border=0></td>
<td><img src="spacer.gif" width=256 height=1 border=0></td>
<td><img src="spacer.gif" width=227 height=1 border=0></td>
</tr>
<!-- table content -->
<tr>
<td width="180" rowspan="3">blank</td>
<td colspan="2">blank</td>
<td rowspan="2" align="right"><img src="images/test.jpg" width="102" height="135"></td>
</tr>
<tr>
<td>blank</td>
<td>blank</td>
</tr>
<tr>
<td colspan="3">blankfr frefref erferf erfrefer fer fer fref erf er ferfreferf
erfrefrefrefer frrefrefre referferfre frerferfref rfrefrefref reiufheruf freiufhiuerhf fuerihfiurehif freifhreiuf fioerhfer fureiufh erfhiuerhfiuehriufhiuer fiuerhife ferfhre urefier</td>
</tr>
</table>
</body>
</html>

That whould fix ya!
Colin

simwit
12-21-2002, 09:42 PM
Spot on Colin ya legend! Worked a treat.

Thanks for the tip :thumbsup:

zoobie
12-21-2002, 11:02 PM
Try &ampnbsp; in there. There's really never any reason to use transparent spacers if you know what you're doing. They just make your page load slower. Spot on that.:D

simwit
12-21-2002, 11:58 PM
Originally posted by zoobie
Try &ampnbsp; in there. There's really never any reason to use transparent spacers if you know what you're doing. They just make your page load slower. Spot on that.:D

Nope. Didn't work. No spot on that ;)

dreamingdigital
12-22-2002, 02:06 AM
there is always a reason to use transparent spacers. what planet do you live on?

zoobie
12-22-2002, 02:46 AM
Nebber used one yet.

PS - Heard that one 20 years ago when you were a toddler in pampers :D

simwit
12-22-2002, 11:33 AM
Everyone stop *****ing. The fact of the matter is that Colin's method worked and I am happy. Zoobie, if you have a solution without spacers, since you never use them, please post it and I'll test it out.

Mr J
12-22-2002, 04:50 PM
<html>
<body>
<table width=780 border="1" cellpadding="0" cellspacing="1">
<tr>
<td width="180" rowspan="3">blank1</td>
<td colspan="2">blank2</td>
<td width="102" rowspan="2"><img src="images/test.jpg" width="102" height="135"></td>
</tr>
<tr>
<td width="256">blank3</td>
<td width="227">blank4</td>
</tr>
<tr>
<td colspan="3" width="483">blankfr frefref erferf erfrefer fer fer fref erf er ferfreferf
erfrefrefrefer frrefrefre referferfre frerferfref rfrefrefref reiufheruf freiufhiuerhf fuerihfiurehif freifhreiuf fioerhfer fureiufh erfhiuerhfiuehriufhiuer fiuerhife ferfhre urefier</td>
</tr>
</table>
</body>
</html>







Sorry, didn't notice the text not going completely to the right border
:confused:

zoobie
12-22-2002, 09:23 PM
If you're happy, just use it.

I'm still trying to figure out what *****ing is.

I guess it's the beautiful weather here...Sunny and 50-60 degrees all month long in der Rockys...Time to get out! :cool:

simwit
12-23-2002, 04:41 PM
sorry. was nothing offensive just bi*ching. p*ssing down with rain in england. there's a change. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum