DIV's vs. Tables or CSS vs. Being Stupid

后端 未结 13 2215
清酒与你
清酒与你 2020-11-27 03:48

I know that tables are for tabular data, but it\'s so tempting to use them for layout. I can handle DIV\'s to get a three column layout, but when you got 4 nested DIV\'s, it

13条回答
  •  爱一瞬间的悲伤
    2020-11-27 04:08

    I would just use the table.

    In my experience, using a table for layout will work the same in all browsers and the CSS will not (especially if you're trying to support IE6). It's just not worth the hours and hours of coding to get a layout to work in CSS when it can be done in 10 minutes using a table.

    The other advantage to using tables is that your layout can very easily dynamically size itself to content. Trying to get that done with CSS is a huge nightmare.

提交回复
热议问题