bugcgicc - Bugs: bug #33305, malformed <col> Tag


bug #33305: malformed <col> Tag

Submitted by:  Andreas Kirsch <kirsche40>
Submitted on:  Fri 13 May 2011 01:13:02 PM UTC  
Votes:  10  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Need Info
Privacy: PublicAssigned to: sebastien diaz <sebdiaz>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Fri 28 Mar 2014 01:34:03 PM UTC, comment #5:

Sorry, the " />" (HTML5) in my previous comment #4 should have been " />" (XHTML) instead.

Thomas Straub <tomstraub>
Fri 28 Mar 2014 12:59:46 PM UTC, comment #4:

It is true HTML expects only <col ...> type elements, and XHTML expects <col ... /> elements, but I have found in practice it doesn't really matter. The <col> elements is one of the most non-standard elements known. In some browsers, I have seen where even <col ...></col> works just fine. As far as I can tell, HTML5 defines the <col> tag as ATOMIC, so I think a simple check when generating ATOMIC elements to see if generating XMTML vs HTML would suffice to determine if to generate a ">" (HTML) or " />" (HTML5) ending tag for all ATOMIC elements would be sufficient.

Thomas Straub <tomstraub>
Mon 14 Jan 2013 01:39:15 PM UTC, comment #3:

I apologize for the wrong document type example at the end of my last comment. A correct line could be

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

Andreas Kirsch <kirsche40>
Mon 14 Jan 2013 01:01:31 PM UTC, comment #2:

The error depends on used specification: HTML vs. XHTML. In HTML a col element must have a start tag but must not have an end tag. See http://www.w3.org/TR/html-markup/col.html. In XHTML every tag shall have an end tag.

Here is a sample to be able to reproduce the issue.

If you generate a colgroup using:

cout << table().set("border", "1") << endl;
cout << colgroup() << endl;
cout << col().set("width", "80") << endl;
cout << col().set("width", "100") << endl;
cout << col().set("width", "320") << endl;
cout << colgroup() << endl;
cout << tr() << endl;
cout << td("text 1") << endl;
cout << td("text 2") << endl;
cout << td("tewt 3") << endl;
cout << tr() << endl;
cout << table() << endl;

You will get the following HTML output where you can see the closing tag of col element:

<table border="1" >
<col width="80" />
<col width="100" />
<col width="320" />
<td>text 1</td>
<td>text 2</td>
<td>text 3</td>

We have to check the HTML tag for the document type if we are HTML or XHTML. In my case it is

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" >

Andreas Kirsch <kirsche40>
Sat 12 Jan 2013 08:05:45 PM UTC, comment #1:

I need more sample to analyse your problem.

The col is purely standalone and should terminate as <col/>

More samples to analyze this bug

sebastien diaz <sebdiaz>
Project AdministratorIn charge of this item.
Fri 13 May 2011 01:13:02 PM UTC, original submission:


the tag <col> is malformed if you use the build in command col() for defining a colgroup. It contains a not allowed '/' before closing bracket.

Andreas Kirsch <kirsche40>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by tomstraub (Posted a comment)
  • -unavailable- added by kirsche40 (Voted in favor of this item)
  • -unavailable- added by kirsche40 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 10 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 Jan 2013 10:07:54 AM UTCsebdiazStatusNone=>Need Info
      Assigned toNone=>sebdiaz
    Sat 10 Sep 2011 04:42:19 PM UTCkirsche40Carbon-Copy-=>Added kirsche40

    Back to the top

    Powered by Savane 3.1-cleanup