Is it good to put <p> inside <td> to put content text?

Jitendra Vyas picture Jitendra Vyas · Dec 22, 2009 · Viewed 45.6k times · Source

Which is more semantic and valid?

<td> 
<p>
 content text
</p>
</td>

or

<td> 
 content text
</td>

Answer

Asaph picture Asaph · Dec 22, 2009

Leave out the <p> tag unless the content of your table cell is truly a paragraph. It's certainly possible to have paragraphs in tabular data, and in that case a semantic <p> would be appropriately placed. But for the common table with data in the cells eg. numbers, names, etc., don't include the <p>.