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


bug #33305: malformed <col> Tag

Submitter:  Andreas Kirsch <kirsche40>
Submitted:  Fri 13 May 2011 01:13:02 PM UTC
Votes: 10
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Need Info
Privacy:  Public Assigned to:  sebdiaz
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

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>
Group administrator
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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    There are 10 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-12 sebdiaz StatusNone Need Info
        Assigned toNone sebdiaz
    2011-09-10 kirsche40 Carbon-Copy- Added kirsche40

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code