RE: Invalid colspan issue

Your table only has 3 columns, so it’s impossible for you to span 6. A better way is to use HTML5 with CSS:

Put this in the <head> area (adjust the .grid width to any size, pixels or percentages):

<style>
div { text-align:center; border-spacing: 4px; }

.grid{ width:50px;}

.col-third {
  width: 33.33%; float:left;
}
.col-half {
  width: 50%; float:left;
}
.col-100 {
  width: 100%; float:left;
}
.grid:after {
  content: "";
  display: table;
  clear: both;
}
</style>

Put this in the <body> area:

<div class="grid">
  <div class="col-100">
     1
  </div>
</div>
<div class="grid">
  <div class="col-half">
     2
  </div>
  <div class="col-half">
     3
  </div>
</div>
<div class="grid">
  <div class="col-third">
     4
  </div>
  <div class="col-third">
     5
  </div>
  <div class="col-third">
     6
  </div>
</div>

This will result in the grid you’re seeking and a page that meets current HTML5 standards.

From: Joel Swanson [mailto:joelswanson@charter.net]
Sent: Tuesday, February 21, 2017 12:35 PM - 12:35 PM
To: www-validator@w3.org
Subject: Invalid colspan issue

The following does not validate.

        <table>
            <tr>
                <td colspan="6">1</td>
            </tr>
            <tr>
                <td colspan="3">2</td>
                <td colspan="3">3</td>
            </tr>
            <tr>
                <td colspan="2">4</td>
                <td colspan="2">5</td>
                <td colspan="2">6</td>
            </tr>
        </table>

I am trying to create a table like this.
[cid:image001.png@01D291F4.8CD87750]
I am getting the following message on the colspan="6" line.

    Table column 2 established by element td has no cells beginning in it

I am assuming it is saying that there are no tds beginning on column 2, and there aren't, but this still should validate in my opinion.

It used to validate under XHTML.

Received on Wednesday, 1 March 2017 00:19:41 UTC