HTML axis Attribute

The obsolete HTML axis attribute was historically used with table header cells to place a header into one or more conceptual categories that could be used when interpreting relationships within complex table data.

Historical Syntax

The axis attribute was added to a table header cell and contained a comma-separated list of category names:

<th axis="location">City</th>
<th axis="population">Population</th>

The category names provided additional information about how table headers and their associated data could be grouped or interpreted.

Historical Elements

The axis attribute was historically associated with table header and data cells.

Element Historical Purpose
<th> Placed a table header cell into one or more conceptual categories.
<td> Could historically provide category information for a table data cell.

Historical Use

The axis attribute was intended for complex data tables where cells could be grouped into broader conceptual categories. A table might contain several related headers that belonged to categories such as location, date, measurement, or another classification chosen by the webpage author.

This information was intended to help user agents interpret table relationships and could provide additional context when navigating or presenting complicated table data.

Why It Became Obsolete

The axis attribute did not become a practical or widely used method for describing table relationships. Modern HTML instead relies on meaningful table structure and more direct associations between header cells and the data they describe.

Using properly structured rows, columns, and header cells generally makes the relationships within a table easier for browsers, assistive technologies, and users to understand.

Modern Alternative

There is no direct replacement for the axis attribute. Modern tables should use appropriate <th> elements and clearly organize headers and data cells so their relationships can be determined from the table structure.

Historical HTML

<table>
  <tr>
    <th axis="location">City</th>
    <th axis="population">Population</th>
  </tr>
  <tr>
    <td>Example City</td>
    <td>25,000</td>
  </tr>
</table>

Modern HTML

<table>
  <tr>
    <th scope="col">City</th>
    <th scope="col">Population</th>
  </tr>
  <tr>
    <td>Example City</td>
    <td>25,000</td>
  </tr>
</table>

For a simple table like this example, the scope="col" attribute identifies each <th> element as a column header. More complex tables may require additional structure or explicit associations between header and data cells.

Legacy Browser Support

The axis attribute was defined for older HTML tables, but support for using its category information was limited and inconsistent. A browser could recognize the attribute without providing any noticeable visual effect.

Browser recognition of the axis attribute does not make it valid modern HTML. When updating an older table, remove the attribute and make sure the table uses meaningful header cells and appropriate modern header associations.

For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.

Other attributes associated with defining or historically describing relationships within HTML tables include:

  • scope - Identifies whether a table header applies to a row, column, row group, or column group.
  • headers - Associates a table data cell with one or more table header cells.
  • abbr - Provides an abbreviated label for a table header cell.
  • char - Historically used to align table cell content on a character.
  • charoff - Historically used with character-based table alignment.

Specifications

The axis attribute on table cells is listed among obsolete and non-conforming features in the WHATWG HTML Living Standard .