Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

TABLE question.

Options
  • 22-11-2001 5:28pm
    #1
    Registered Users 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 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