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
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, In the past, 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.
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.