# Attribute “height” not allowed on element “table” at this point.

> Canonical HTML version: https://rocketvalidator.com/html-validation/attribute-height-not-allowed-on-element-table-at-this-point
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `<table>` element in HTML supports a limited set of attributes — primarily global attributes like `class`, `id`, and `style`. The `height` attribute was never part of the HTML standard for tables (unlike `width`, which was valid in HTML 4 but has since been deprecated). Despite this, many browsers historically accepted `height` on `<table>` as a non-standard extension, which led to its widespread but incorrect use.

Because `height` is not a recognized attribute on `<table>`, using it means your markup is invalid and may behave inconsistently across browsers. Some browsers might honor it, others might ignore it entirely, and future browser versions could change their behavior at any time. Relying on non-standard attributes makes your code fragile and harder to maintain.

The fix is straightforward: remove the `height` attribute from the `<table>` element and use CSS to set the desired height. You can apply the CSS inline via the `style` attribute, or better yet, use an external or internal stylesheet with a class or ID selector.

## Examples

### ❌ Invalid: `height` attribute on `<table>`

```html
<table height="300">
  <tr>
    <td>Name</td>
    <td>Score</td>
  </tr>
  <tr>
    <td>Alice</td>
    <td>95</td>
  </tr>
</table>
```

This triggers the validator error: **Attribute "height" not allowed on element "table" at this point.**

### ✅ Fixed: Using inline CSS

```html
<table style="height: 300px;">
  <tr>
    <td>Name</td>
    <td>Score</td>
  </tr>
  <tr>
    <td>Alice</td>
    <td>95</td>
  </tr>
</table>
```

### ✅ Fixed: Using a CSS class (preferred)

```html
<style>
  .tall-table {
    height: 300px;
  }
</style>

<table class="tall-table">
  <tr>
    <td>Name</td>
    <td>Score</td>
  </tr>
  <tr>
    <td>Alice</td>
    <td>95</td>
  </tr>
</table>
```

Using a class keeps your HTML clean and makes it easy to adjust the styling later without touching the markup. Note that `min-height` is often a better choice than `height` for tables, since table content can naturally grow beyond a fixed height, and `min-height` ensures the table is at least a certain size without clipping content.
