I’m making a “table” using CSS and DIVs and I’m needing one of the cells to stretch while the others are fixed. The code looks a little something like this right now, and I’m wanting “anotherCell” to stretch to fill up the remaining space.
Don’t forget to add vertical-align:top to that rule or the items will align on the baseline and could look odd if images are involved.
Yes that’s the beauty of cells and they don’t need widths as all the cells in a row must always equal the width of the parent row. This means that if you give a width to one cell then the other cells will still stretch to fill the available space. Even if you did size all three cells to be smaller than the table width the browser would call that ‘over-constrained’ and ignore the dimension on one of the cells to allow it to extend to the width of the table.
Well, I have a width of 100% on both the table and table-row classes and it still doesn’t seem to be stretching the one cell. The two cells with explicit widths look like they should but the cell with no width is as small as possible.