• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 6. Tables > What Elements Can Be Placed in a Table Cell?

What Elements Can Be Placed in a Table Cell?

HTML 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> tag between the <TD> and </TD> tags that define 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 put a blank cell in a table. You can accomplish this by putting nothing between the cell's defining tags (<TD></TD>) or by placing a nonbreaking space between the tags (<TD>&nbsp;</TD>). Use of the nonbreaking space is preferable because, if you have borders turned on, a cell with a nonbreaking space picks up a border, but a cell created with <TD> </TD> may not.

  • Form fields— The ability to place form fields inside of a table cell is very important, especially when you consider that the prompting text in front of form fields are of varying lengths. By putting prompting text and form fields in a table, you can align them all and make the form much more readable.

  • Other tables— You can embed one table inside of another, although this can induce quite a headache for many people! Previously, only Netscape Navigator and Microsoft Internet Explorer supported tables within tables; but now that it is part of the HTML 4.0 standard, other browsers should support it as they come into compliance with the new standard.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint