The HTML table element (<table>) is divided into rows (<tr>), and each row may contain a number of table data cells (<td>) or (<th>).

The <table>, <tr>, <td>, and <th> elements support two attributes: (i) align and (ii) valign.

(i) align

You use align to horizontally arrange items within a table cell. The possible values are as follows:

  • "left" to left-align the content in a cell.
  • "center" to center-align the content in a cell.
  • “right” to right-align the content in a cell.
  • “justify” to stretch the content with equal width.
  • "char" to align the content to a specific character.

(ii) valign

You use valign to vertically arrange items within a table cell. The possible values are as follows:

  • "top" to top-align the content in a cell.
  • "middle" to center-align the content in a cell.
  • "bottom" to bottom-align the content in a cell.

The table element shown in the figure below will be rendered in a DocBook format as in figure below.

HTML Tag for a Fragment of Table

DocBook Tag for a Fragment of Table