Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Location
    Middle of Japan
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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:



    This comes from the script of:

    Code:
    <!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.

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    495
    Thanks
    0
    Thanked 82 Times in 80 Posts
    Code:
    <!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.
    Last edited by Fang; 09-17-2007 at 12:36 PM.

  • #3
    New to the CF scene
    Join Date
    Sep 2007
    Location
    Middle of Japan
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •