...

View Full Version : I'm missing SOMETHING: Is it old or am I able to mix <COL width=x w/ <COL width=1*?



Quantainne
09-17-2007, 07:24 AM
Something's off here, but when you have two columns flanking a col of fixed width, and you want the layout to be automatically symmetrical, that goes:

<tr>
column set with td width="1*"
column set with td width=[e.g.] 280
column set with td width="1*"

... right? I get these awful results both with a COLGROUP and without:

http://www.ne.jp/asahi/er/ic/results.jpg

This comes from the script of:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<BODY>

<TABLE border=1 style="width: 500px" cols=3>
<COLGROUP>
<COL width="1*">
<COL width="250">
<COL width="1*">
<TR>
<TD>125px?
<TD><img src="orch.jpg"><!--Results are same with TD width=250-->
<TD>125px?
</TABLE>
<br>

<TABLE border=1 style="width: 500px" cols=3>
<TR>
<TD width="1*">125px?
<TD width="250"><img src="orch.jpg">
<TD width="1*">125px?
</TABLE>

Since the image is 250px wide, I'm expecting the left and right columns to have widths of 125px each, yet they come up scrawny at 55px wide, and that's only due to their word of text -- if they were empty or had only an nbsp, they'd be tiny. Meanwhile, the center column that I specced at 250 is yawning way open, and that needs to be tight around the image. Naturally I can do the arithmetic and give numerical widths for the left/right columns, but if I set 200 tables that way, and then change the image, I'm back to revising tags in 200 files. There's also the style="width: expression(variableName)" approach, but these tables get uploaded to the Yahoo auction out here, and all JS is automatically stripped, so these have to be JS-free pages, and besides I'd like to see what's up with this elusive proportional width symbol.

Any hint on my goof?

Thanks.

Fang
09-17-2007, 12:25 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>dividing columns</title>
</head>
<body>
<table border="1" style="width:500px;">
<colgroup>
<col>
<col width="250">
<col>
</colgroup>
<tr>
<td>125px?</td>
<td><img style="display:block;" src="orch.jpg" alt=""></td>
<td>125px?</td>
</tr>
</table>

<table border="1" style="width:500px;">
<colgroup>
<col width="*">
<col width="250">
<col width="*">
</colgroup>
<tr>
<td>125px?</td>
<td><img src="orch.jpg" alt=""></td>
<td>125px?</td>
</tr>
</table>
</body>
</html>

Don't use the proportional spec., IE tends to mess it up in more complex layouts.

Quantainne
09-17-2007, 01:18 PM
Wow -- a direct solution, two of them, a model of form, not a wasted word. One of the lessons is that nonchalant, unclosed tags are self-defeating, especially when the page isn't rendering right.

Many thanks, Fang.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum