# Table columns in range X…Y established by element “th” have no cells beginning in them.

> Canonical HTML version: https://rocketvalidator.com/html-validation/table-columns-in-range-x-y-established-by-element-th-have-no-cells-beginning-in-them
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A `<th>` with a `colspan` wider than the rest of the table adds the columns in the reported range, and no `<td>` or `<th>` begins in any of them.

The validator builds the table grid from each row's cells and their `colspan` values. A `<th colspan="4">` that starts in column 2 covers columns 2 to 5, so the table has at least five columns. The HTML table model requires every column to have at least one cell that starts in it, and a cell that only crosses a column through `colspan` doesn't count. If the other rows have only two cells, nothing starts in columns 3 to 5, and the validator reports them as the range `3…5`, naming `th` as the element that created them.

This often happens with header rows that group headings over more columns than the body has, or with a `colspan` left over from a wider version of the table. The short rows usually add a warning too: "A table row was 2 columns wide, which is less than the column count established by the first row (5)." When only one column is empty, the validator names that single column ("Table column 3") instead of a range.

To fix it, lower the `colspan` so the header covers only the columns the rows use. If the table really needs the extra columns, add cells to the other rows so a cell starts in each of them.

## Invalid example

The second heading spans four columns, but each body row has only two cells:

```html
<table>
  <tr>
    <th>Term</th>
    <th colspan="4">Dates</th>
  </tr>
  <tr>
    <td>Autumn</td>
    <td>September to December</td>
  </tr>
</table>
```

## Valid example

Without the `colspan`, the header and the body both have two columns:

```html
<table>
  <tr>
    <th>Term</th>
    <th>Dates</th>
  </tr>
  <tr>
    <td>Autumn</td>
    <td>September to December</td>
  </tr>
</table>
```
