# Bad value “” for attribute “rowspan” on element “td”: The empty string is not a valid non-negative integer.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-for-attribute-rowspan-on-element-td-the-empty-string-is-not-a-valid-non-negative-integer
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `rowspan` attribute on a `<td>` must hold a whole number from 0 to 65534, so leaving it empty is an error.

A bare `rowspan` with no value counts as empty and gets the same message. A value made of spaces, or a negative number like `-1`, gets a different error that starts with "Expected a digit".

Empty `rowspan` attributes often come from table plugins and page builders that write both span attributes on every cell and leave them blank when no cells were merged. Check the same cells for `colspan=""`, which the validator reports in its own message ending in "not a valid positive integer".

Browsers read an empty `rowspan` as 1, the same as no attribute, so deleting it leaves the table unchanged. Don't reach for `rowspan="0"` as a replacement: it is valid, unlike `colspan="0"`, but it stretches the cell down through every remaining row of its `<thead>`, `<tbody>` or `<tfoot>`. Write the attribute only on cells that cover two or more rows.

## Invalid example

```html
<table>
  <tr>
    <th>Day</th>
    <th>Time</th>
    <th>Session</th>
  </tr>
  <tr>
    <td rowspan="2">Monday</td>
    <td rowspan="">9:00</td>
    <td rowspan="">Welcome</td>
  </tr>
  <tr>
    <td>11:00</td>
    <td>Workshop</td>
  </tr>
</table>
```

## Valid example

```html
<table>
  <tr>
    <th>Day</th>
    <th>Time</th>
    <th>Session</th>
  </tr>
  <tr>
    <td rowspan="2">Monday</td>
    <td>9:00</td>
    <td>Welcome</td>
  </tr>
  <tr>
    <td>11:00</td>
    <td>Workshop</td>
  </tr>
</table>
```
