# Table column N established by element “col” has no cells beginning in it.

> Canonical HTML version: https://rocketvalidator.com/html-validation/table-column-n-established-by-element-col-has-no-cells-beginning-in-it
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

This table's `<col>` elements declare more columns than its rows fill, so column N has no `<td>` or `<th>` starting in it.

Each `<col>` inside a `<colgroup>` adds one column to the table, or as many columns as its `span` attribute says. The HTML table model then requires every column to have at least one cell that begins in it. A cell that only reaches the column through `colspan` doesn't count: with `<col span="3">` and a row of `<td>Alice</td><td colspan="2">2019</td>`, column 3 is still reported.

The usual cause is column markup that no longer matches the content, such as a template that always writes the same `<colgroup>`, or a column removed from every row but left in the `<colgroup>`. Rows shorter than the column markup also trigger a companion error, "A table row was 2 columns wide, which is less than the column count established using column markup (3)".

To fix it, make the column markup match the rows. Remove the extra `<col>` elements or lower their `span`, or add the missing cells if that column should hold data.

## Invalid example

Three `<col>` elements, but every row has only two cells:

```html
<table>
  <colgroup>
    <col class="name">
    <col class="role">
    <col class="year">
  </colgroup>
  <tr>
    <th>Name</th>
    <th>Year</th>
  </tr>
  <tr>
    <td>Alice Moreno</td>
    <td>2019</td>
  </tr>
</table>
```

## Valid example

The `<colgroup>` declares the same two columns the rows use:

```html
<table>
  <colgroup>
    <col class="name">
    <col class="year">
  </colgroup>
  <tr>
    <th>Name</th>
    <th>Year</th>
  </tr>
  <tr>
    <td>Alice Moreno</td>
    <td>2019</td>
  </tr>
</table>
```
