Skip to main content
HTML Validation

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

About This HTML Issue

A rowspan on a <th> sets how many rows the header cell covers, and it only accepts a whole number from 0 to 65534, so rowspan="" fails validation.

The validator reports a bare rowspan, written with no value, in exactly the same way. A value that holds only spaces, or a negative number such as -1, produces another message instead, one that begins with "Expected a digit".

The usual source is a header row generated by a table plugin or theme that prints rowspan and colspan on every <th> and leaves them blank when the cells aren't merged. Look at those headers for colspan="" as well. The validator flags it in a separate message, "not a valid positive integer", because colspan has to be at least 1.

An empty rowspan makes no visual difference: browsers read it as 1, the same value they use when the attribute is absent, so you can delete it safely. Avoid swapping in rowspan="0". That value passes validation, but it makes the header reach down to the last row of its <thead>, <tbody> or <tfoot>. Leave rowspan only on headers that span two or more rows, such as a row header that labels a group of rows.

Invalid example

<table>
  <tr>
    <th rowspan="">Region</th>
    <th rowspan="">Store</th>
    <th rowspan="">Sales</th>
  </tr>
  <tr>
    <th rowspan="2">North</th>
    <td>Leeds</td>
    <td>1,200</td>
  </tr>
  <tr>
    <td>York</td>
    <td>950</td>
  </tr>
</table>

Valid example

<table>
  <tr>
    <th>Region</th>
    <th>Store</th>
    <th>Sales</th>
  </tr>
  <tr>
    <th rowspan="2">North</th>
    <td>Leeds</td>
    <td>1,200</td>
  </tr>
  <tr>
    <td>York</td>
    <td>950</td>
  </tr>
</table>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries