Why use tables to structure your layout?

后端 未结 14 840
孤城傲影
孤城傲影 2020-12-23 23:02

Looking at the source code for Stack Overflow, I noticed they have used tables and inline CSS quite a bit, also something I found odd was use of inline table attribute forma

14条回答
  •  天涯浪人
    2020-12-23 23:43

    Tables and layout

    SO's layout is not based on tables.

    At a quick glance, I'd say SO layout is 80% div-based and 20% table-based. Tables are used in the header and on the "badges" box. Table use is appropriate for badges IMHO (it's a list of items, after all), not so good for the header.
    Anywhere else, divs are used.

    Inline CSS

    Again, many inline definitions are used (probably to quickly mockup site's structure), but SO correctly uses also css (to style the divs and to provide print formatting).

提交回复
热议问题