Skip to content

epub writer: <col> should be within <colgroup> in tables #877

MichaelKofler opened this Issue Jun 7, 2013 · 5 comments

3 participants


I tried to publish an ebook at Apple using the iTunes Producer. This program complained that <col> elements where not allowed within a table. I.e.

<table><col xxx/><col yyy/>

is wrong. I manually changed the xhtml file to

<table><colgroup><col xxx/><col yyy/> </colgroup>

and it was OK. Not sure if there is an epub standard for this.

Markdown sample to produce the table which triggers this error:

---------------- ---------------------------------------------
**row1**         bla

**row2**         bla bla
jgm commented Jun 8, 2013

As far as I can see, the output pandoc produces is valid xhtml. There is no requirement that col elements be nested inside a colgroup. I've verified this by validating pandoc's output at If this is wrong, please supply evidence that the xhtml spec requires col elements to be inside colgroup. Otherwise, it seems to me that this is a bug in iTunes Producer, not pandoc.


I just re-read the xhtml specification. You are of course right. I'll try to complain at Apple ...

omerida commented Mar 5, 2014

Just wanted to mention that epubcheck also complains about col elments not within a colgroup. It didn't raise that error for me when I switched to using a pipe delimited table.

omerida commented Mar 5, 2014

Although, I just ran the generated html for my epub through the W3C's validator. Validator gave the following error:

XHTML element col not allowed as child of XHTML element table in this context. (Suppressing further errors from this subtree.)

For this HTML:

…s.</p><table><col style="width: 51%" /><col style="width: 47%" /><tbody><tr cl…

Details about the col element link to an HTML5 document

@jgm jgm reopened this Mar 5, 2014
@jgm jgm added a commit that closed this issue Mar 5, 2014
@jgm HTML writer: Add colgroup around col tags.
Also affects EPUB writer.
Closes #877.
@jgm jgm closed this in f3c9d37 Mar 5, 2014
omerida commented Mar 5, 2014

Thank you! Looking forward to the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.