# no-table-as-layout

Rule `sonarjs/no-table-as-layout`. HTML "<table>" should not be used for layout purposes

- Source: sonarjs
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1318 by reach, #619 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-table-as-layout` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-5257/) |

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/no-table-as-layout": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/no-small-switch](https://lintradar.dev/rules/sonarjs/no-small-switch.md): "if" statements should be preferred over "switch" when simpler
- [sonarjs/no-trivial-assertions](https://lintradar.dev/rules/sonarjs/no-trivial-assertions.md): Assertions should not be trivially true
- [sonarjs/no-skipped-tests](https://lintradar.dev/rules/sonarjs/no-skipped-tests.md): Tests should not be skipped without providing a reason
- [sonarjs/no-try-promise](https://lintradar.dev/rules/sonarjs/no-try-promise.md): Promise rejections should not be caught by "try" blocks
- [sonarjs/no-session-cookies-on-static-assets](https://lintradar.dev/rules/sonarjs/no-session-cookies-on-static-assets.md): Static Assets should not serve session cookies
- [sonarjs/no-undefined-argument](https://lintradar.dev/rules/sonarjs/no-undefined-argument.md): "undefined" should not be passed as the value of optional parameters

---

Web page: https://lintradar.dev/rules/sonarjs/no-table-as-layout. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
