Which Elements Can Be Placed in a Table Cell?

XHTML tables were developed with the intent of presenting columns of information, but that information does not necessarily have to be text based. You can place many types of page elements in a given table cell:

  • Text— Text is the most obvious thing to put in a table cell, but don't forget that you can format the text with physical and logical styles, heading styles, list formatting, line and paragraph breaks, and hypertext anchor formatting.

  • Images— You can place an image in a table cell by enclosing an <img/> element within the <td> element that defines the cell. This is useful for designing page layout with tables because you aren't constrained only to text.

  • Blank space— Sometimes it's useful to ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.