Skip to main content
HTML Validation

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

About This HTML Issue

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

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

Valid example

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

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries