# Bad value X for attribute “dir” on element “table”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-dir-on-element-table
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `dir` attribute on `<table>` only accepts `ltr`, `rtl` or `auto`, so a value such as `none` is invalid.

`dir` sets the base direction of the table. It affects the text inside each cell and also the column order: with `rtl` the first column sits on the right edge of the table, with `ltr` on the left. `auto` lets the browser pick the direction from the first strongly directional character in the content.

HTML has no keyword that switches direction off. A table without `dir` inherits the direction of its parent, usually set on the `<html>` element, which is probably what `none` was meant to do. Remove the attribute, or set `ltr` or `rtl` when the table needs a different direction from the rest of the page. An empty `dir=""` is invalid for the same reason.

## Invalid example

```html
<table dir="none">
  <tr>
    <th>Size</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Small</td>
    <td>4.50</td>
  </tr>
</table>
```

## Valid example

```html
<table>
  <tr>
    <th>Size</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Small</td>
    <td>4.50</td>
  </tr>
</table>
```
