CENTER - Centered Block

Syntax <CENTER>...</CENTER>
Attribute Specifications
Contents ,
Contained in , , , , , , , , , , , , , , , , , ,

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

CENTER is still useful for centering since many browsers lack support for <TABLE ALIGN=center> as well as the method of centering tables with Cascading Style Sheets (setting and 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 to center the contents of each cell. The property of provides greater flexibility in suggesting horizontal alignment.

More Information