Table column with width indications

7 posts / 0 new
Last post

Hi,

I forwarded the following issue report to the epubcheck-team:

-----
Is it possible to add the width attribute to the list of exceptions, when used within a <col> element? Example: <col width="29%" />. epubcheck gives an error, when indicating it this way.

There is no real other practicable way of indicating the width.

Not Working: Adding a style attribute (<col style="width:29%;" />) or putting the width into the CSS and adding a class to the <col> element.

The only other way getting it done is putting the width into the CSS and applying the class to every <td>-element. But someone who did already this job, knows that this is painful and extremely time consuming.
-----

My question to you is: Is it even allowed to have <col width="29%" /> included in an ePub 3 document?

If not or not defined, may I request to add it to the next ePub revision?

Kind regards,
Yves

The short answer is: no, it's invalid HTML5 markup so it's not allowed in EPUB 3.

You're technically asking for a change to HTML5 to re-include, so you'd have to request this change to the HTML WG. The EPUB WG doesn't make decisions about what elements/attributes are valid within core HTML5, so adding attributes that have been removed probably wouldn't get much traction (I'd expect the best you could request would be an epub: namespaced attribute, but that wouldn't get you any better support).

If distribution isn't dependent on successful validation, you could ignore the error, but it's interesting you find better support with a removed attribute. Are you looking for compat with EPUB 2 RSes, or what v. 3 reading system are you having this trouble on?

Hi Matt,

I exactly feared this answer. I hoped there is a way to put exceptions into the ePub/HTML5 definitions for some elements.

MGA: If distribution isn't dependent on successful validation, you could ignore the error, but it's interesting you find better support with a removed attribute.

YAP: That's exactly my problem. I have better support leaving the attribute within the col element, especially for ePub 3 or HTML5. But it's not valid anymore so I can't forward it to shops, which require the validation.

MGA: Are you looking for compat with EPUB 2 RSes, or what v. 3 reading system are you having this trouble on?

YAP: I'm looking to get my table working within an ePub 3. As soon as I put the width for the col element into the CSS, no one of the major ePub readers does show the table as expected:

I've tested on:
- Bookle (OSX) --> Not working
- ClearView (OSX) --> Not working
- ePub Reader (OSX) --> Not working
- ePub Viewer (OSX) --> Not working
- Readium --> Not working
- ePub Reader (Firefox) --> Not working
- iBooks --> Not working
- Kobo (iOS) --> Not working
- Himawari Reader (Android) --> Not working
- Astri-Bee (Android) --> Not working
- (Kindle KF8 conversion) --> Not working

- ADE --> working
- Lumiread (Android) --> Working
- Bluefire (Android) --> Working
- Some other ePub 2 readers --> Working with other restrictions

Pretty much frustrating if nearly all available e-readers which can read ePub 3 do not render the col element anymore when the width is in the CSS. If I put it directly as attribute within the col element, the e-readers render the table as it should.

Even worse is that nearly all of the readers only supporting ePub 2, render the ePub 3 file with the width in the CSS, correctly.

Topsy-Turvy World!

(Here you can find a test file: https://dl.dropboxusercontent.com/u/9429870/ePub-Test-file-Table-width.epub)

Kind regards,
Yves

Update:

Also tested:
- Gyan (Android) --> Not working
- Lektz (Android) --> Not working
- Gitden (Android) --> Not working

Strange, it works for me. I get two 10% width columns and an 80% width column using the file you provided, including modifying to use @style instead of @class. I also tried setting background colours just for fun.

I didn't test the whole range you did, but Readium, Kobo, Lektz, iBooks, and even the accessible IDEAL reader and Blio (where I thought there might be the greater chance for less visual rendering support) all displayed the table correctly. This was running all the current releases on a Nexus 7 running 4.3, with an ipad mini for iBooks and win7 for Readium.

I found the error. What a shame.

The table itself was not set to 100%. You need to explicitly indicate this for the table, even if E-Readers should fit the table by default (like iBooks).

Sorry, I haven't seen this. Thanks for pointing me in the right direction!

Not sure I did much, but glad to hear you got it worked out, and that it's not a problem with support in the end.

Secondary menu