开发者

Expand width of final cell in a div table?

开发者 https://www.devze.com 2023-02-08 09:12 出处:网络
I\'m working on constructing a table using only divs. I began creating the table using percentages 开发者_Python百科to set column widths, but would prefer to just use table-cell and not have to worry

I'm working on constructing a table using only divs. I began creating the table using percentages 开发者_Python百科to set column widths, but would prefer to just use table-cell and not have to worry about things that way. Only problem is I'm not guaranteed to have the same number of elements in every row.

http://jsfiddle.net/JWvLX/

This example shows what is currently happening in the top two rows, and what I want to happen if a cell is removed/not present in the bottom two rows.

What exactly do I need to do to accomplish this? Is this possible using only divs for tables or will I be forced to use actual tables to get the desired effect.


There's no equivalent for colspan/rowspan in CSS tables, but this Sitepoint post has some trickery you might be able to use.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号