Alex Rivera | Logout

Make "Greedy" Table Cell?

Asked 2011-08-19T19:59:46.167
11

I have a row in a table that has 3 cells in it with values A, B, and C and the table is the full width of the screen, which is more than enough room for all 3. Right now, when they display, all cells are getting 1/3 of the room, but this isn't what I want. I want the 2nd and 3rd cells to be their "correct" size, and the first cell to take up the difference. I can't just set the width on them because they are dynamically sized. How can I do this?

Edit
Report

2 Answers

4

Just set the width of the table to 100%, the width of A to 100% and B and C to auto. Tested and working

<table border="1px" width="100%">
    <tr>
        <td width="100%">A</td>
        <td width="auto">BB</td>
        <td width="auto">CCC</td>
    </tr>
</table>
answered 2011-08-19T20:24:39.653
-1

I tried Diodeus and Rune's methods, but it didn't work for my example. I ended up doing a merge on cells B and C as I couldn't really find anything. Thanks for your help.

answered 2011-08-20T19:58:27.230

Your Answer