Abscissa Tech Home Design Coding Media Server
Tutorials Courses Forums Resources
  Home
 
  Member Options
    Sign Up
  Log In
 
  Tools
    PowerHTML
    Teacher's Lounge
  References
  HTML
  PHP
  CSS
 
  Search
 
 
    Legalese
    Contact Us
    Privacy Policy
    About Abscissa

The Web Design Group

CENTER - Centered Block

Syntax <CENTER>...</CENTER>
Attribute Specifications
Contents Inline elements, block-level elements
Contained in APPLET, BLOCKQUOTE, BODY, BUTTON, CENTER, DD, DEL, DIV, FIELDSET, FORM, IFRAME, INS, LI, MAP, NOFRAMES, NOSCRIPT, OBJECT, TD, TH

The CENTER element defines a block whose contents are centered horizontally on visual browsers. <CENTER> is a shorthand for <DIV ALIGN=center>, though CENTER is slightly better supported among browsers. Both methods of centering are deprecated in favor of style sheets.

CENTER is still useful for centering tables since many browsers lack support for <TABLE ALIGN=center> as well as the method of centering tables with Cascading Style Sheets (setting margin-left and margin-right to auto). An example follows:

<CENTER>
  <TABLE>
    <TR ALIGN=center>
      <TH SCOPE=col>Name</TH>
      <TH SCOPE=col>Age</TH>
      <TH SCOPE=col>Country</TH>
    </TR>
    <TR ALIGN=center>
      <TD>Liam Quinn</TD>
      <TD>20</TD>
      <TD>Canada</TD>
    </TR>
  </TABLE>
</CENTER>

Note that CENTER only centers the table as a whole, not the contents of each table cell. The preceding example uses the ALIGN attribute of TR to center the contents of each cell. The text-align property of Cascading Style Sheets provides greater flexibility in suggesting horizontal alignment.

More Information

This document was modified from the Web Design Group's original work. The Web Design Group takes no responsibility for any errors introduced.