Forum Moderators: open

Message Too Old, No Replies

Div inside table?

         

Northstar

7:49 pm on Mar 10, 2009 (gmt 0)

10+ Year Member



Is it ok to put a DIV inside a table? I have a program that is producing link list content and it is causing hundreds of nested tables. I'm worried this could be hurting my SEO and would like to change the nested tables to DIV's. Would there be any problem with this?

rocknbil

11:21 pm on Mar 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't put a div inside a table, but you can put a div inside a table td. I know that's what you meant. :-)

<table>
<tr><td><div>content</div></td></tr>
</table>

The question is: is a div really what you want? Would a paragraph, <ul>, or other semantic element that describes the content be a better choice? You can style these with no spacing if the element in question gives you trouble:

table td p { margin:0;padding:0; }