W3C home > Mailing lists > Public > www-validator@w3.org > March 2017

RE: Invalid colspan issue

From: O'Guin, Phaewryn D. <JDO09280@ccv.vsc.edu>
Date: Wed, 1 Mar 2017 00:03:04 +0000
To: Joel Swanson <joelswanson@charter.net>, "www-validator@w3.org" <www-validator@w3.org>
Message-ID: <SN1PR0101MB16163F4F951087C7C29A8AD4CC290@SN1PR0101MB1616.prod.exchangelabs.com>
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.


image001.png
(image/png attachment: image001.png)

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

This archive was generated by hypermail 2.3.1 : Wednesday, 1 March 2017 00:19:45 UTC