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

Chapter 8. Basics Tables > Additional Table Attributes

Additional Table Attributes

Now that you have created a basic table, you can move on to a more advanced understanding of the <table> element itself and its optional attributes. You’ve already seen some of them, including align and border, but a few others are worth examining:

  • width—Sets the relative width of your table as part of the browser window (or an absolute width), usually in pixels. The values can be either percentages, as in width="50%", or an integer representing pixels.

  • border—Defines the width of the border surrounding the table. The value is a number (integer) in pixels.

  • align—Not strict XHTML, but it can be handy if you’re using the XHTML Transitional DTD. align can be used much as it’s used for the <img> element, enabling you to create a “floating” table that enables text to wrap around it.

  • cellspacing—Tells the browser how much space to include between the walls of the table and between individual cells. The value is a number (an integer) in pixels.

  • cellpadding—Tells the browser how much space to use between data elements and the walls of the cell. The value is a number in pixels.

  • rules and frames—Used to determine which lines are drawn between cells (rules) and around the table (frames). This one is exclusive to visual browsers, but it’s allowed under the XHTML Strict DTD.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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