Which elements are “valid” to place inside tag?

后端 未结 2 1980
囚心锁ツ
囚心锁ツ 2021-02-12 19:39

I know that it\'s not a good idea to place div inside td, but what about span and other elements? Which elements are ok to place inside

2条回答
  •  野的像风
    2021-02-12 19:49

    The idea that you shouldn't put a div inside a table is more about using semantic markup with CSS to style the layout.

    That being said,

    and its related elements should be used to display data in a tabular format. If it makes sense for one of the cells in the table to contain more complex markup, then so be it.

    In the past,

    was used because it easily gave a website a grid layout, but this should now be done using CSS to allow your site to be more accessible.

    提交回复
    热议问题