# Bad value “” for attribute “colspan” on element “th”: The empty string is not a valid positive integer.

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

A `colspan` on a `<th>` has to say how many columns the header covers, as a whole number from 1 to 1000, so `colspan=""` is invalid.

Writing `colspan` with no value at all gives the same message. If the value holds only spaces, as in `colspan=" "`, the validator reports it differently, with a message that begins "Expected a digit".

Header cells often end up like this when a table plugin or theme writes the span attributes on every `<th>` and fills them from a setting that is blank for most columns. Check the same headers for `rowspan=""`. The validator flags it separately, as "not a valid non-negative integer", because `rowspan` also accepts 0.

An empty `colspan` changes nothing on screen: browsers read it as 1, just as they do when the attribute is missing. Remove it from every header that sits over a single column, and keep a number only where a header groups several columns, such as `colspan="2"` above two related columns.

## Invalid example

```html
<table>
  <tr>
    <th colspan="">Course</th>
    <th colspan="2">Schedule</th>
  </tr>
  <tr>
    <td>Biology</td>
    <td>Monday</td>
    <td>Wednesday</td>
  </tr>
</table>
```

## Valid example

```html
<table>
  <tr>
    <th>Course</th>
    <th colspan="2">Schedule</th>
  </tr>
  <tr>
    <td>Biology</td>
    <td>Monday</td>
    <td>Wednesday</td>
  </tr>
</table>
```
