Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

TABLE question.

  • 22-11-2001 05:28PM
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    I'm trying to make a table with each 1st cell of each row would be a different size.

    Is this even possible?

    something like...
    <TABLE WIDTH=50%>
    <TR><TD WIDTH=40% BGCOLOR=RED></TD></TR>
    <TR><TD WIDTH=20% BGCOLOR=Blue></TD></TR>
    </TABLE>
    

    But the cells come out the same size. What am I missing?


Comments

  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    You only actually need to specify the widths of table cells in the first row, all other rows will have to follow. That's why you're seeing them both as the same size.

    You could try using the colspan attribute in the TD but it might get ugly. What are you trying to do?
    If it's a graph, use images with relative width attributes.
    In fact even if it's not a graph, you could use an image to do you're coloring, or use nested tables in your td to get the desired effect. It would be ugly mind.


  • Closed Accounts Posts: 512 ✭✭✭beaver


    Not possible. They work like columns and have to be the same size.

    Best way is like Enygma said, use nested tables...
    <TABLE>
    
    <TR>
    <td><TABLE>
    <TR>
    <td width='10%'>blah</td>
    </TR>
    </TABLE></td>
    </TR>
    
    <TR>
    <td><TABLE>
    <TR>
    <td width='20%'>yakkity yak</td>
    </TR>
    </TABLE></td>
    </TR>
    
    </TABLE>
    

    This way you're only dealing with one large cell in each row of the original table.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Actually I did this. :)
    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
    <!--- Sets the scale --->
    <TR><TD COLSPAN=1></TD><TD COLSPAN=1 BGCOLOR=White></TD></TR>
    
    <TR><TD COLSPAN=5><FONT SIZE=1>Item 1</FONT></TD>
    <TD COLSPAN=10 BGCOLOR=Green></TD></TR>
    
    <TR><TD COLSPAN=5><FONT SIZE=1>Item 2</FONT></TD>
    <TD COLSPAN=15 BGCOLOR=Red></TD></TR>
    
    <TR><TD COLSPAN=5><FONT SIZE=1>Item 3</FONT></TD>
    <TD COLSPAN=25 BGCOLOR=Blue></TD></TR>
    </TABLE>
    

    Doesn't work in everything but it renders fine in what I wanted. :)


Advertisement