05-31-2014, 02:14 AM | #1 |
New old guy
Posts: 69
Karma: 10
Join Date: Feb 2012
Device: kindle fire
|
epub table/column widths
I am trying to learn everything I can about coding tables for epub. I have read every tutorial and forum I can find, but can't find anything other than obvious basics. I need to have a table that changes its width in accordance with the fonts and page widths being used in an epub eReader, and the columns maintain the same relative width dependent on the width of the table. Seems like a basic task, but nothing I can figure to do actually works: for me, the obvious solution is to work in percents, set table width at 100% and each column to a fraction of 100% so that the total for all columns add up to 100% -- but that doesn't work. The result seems almost random -- some smaller columns, some larger columns, and left-over table space.
I would appreciate any ideas on how to do what I want -- surely it is something that many of you know how to do. BTW -- wouldn't it be something to have a WYSIWYG table generator in Sigil where you simply drag the column lines and table border to what you want and let Sigil generate the code? Could even include setting background and font colors of cells, columns, rows... RW |
05-31-2014, 04:51 AM | #2 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
Try CSS rule:
Code:
table-layout:fixed; 1. It has many more functions. 2. It supports both EPUB 2 and EPUB 3 creation. 3. Its development is on-going. |
05-31-2014, 05:07 AM | #3 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
have I missed an update where the Calibre editor now creates ePUB3? AFAK the editor supports ePUB2 and AZW.
Sent from my Nexus 5 using Forum Fiend v1.2.5. |
05-31-2014, 05:09 AM | #4 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
My bad, I meant to say it won't remove or change your code automatically like Sigil does... yes yes, I know you can disable that feature in Sigil.
Anyhow, those reasons were only 3 main ones, there are plenty more why one should abandon Sigil :P |
05-31-2014, 05:21 AM | #5 | |
Bookmaker & Cat Slave
Posts: 11,461
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
05-31-2014, 05:59 AM | #6 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
|
05-31-2014, 08:13 AM | #7 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Yes, she is and so am I. There is absolutely no reason to switch over besides personal preference. I am still working with Sigil and it works more than fine. There is no feature currently in Calibre that I miss in Sigil. Just that Sigil is not maintained anymore does not make it stop working.
What I really don't like is that you can create an invalid (according to the specs) ePUB in the Calibre Editor and that the check-book function will not complain about it. The explanation from Kovid that if a non-compliance does not create an issue in the devices (as far as he knows), he is fine with it, does not cut it. If you want to publish an ePUB, most services require full compliance. |
05-31-2014, 09:56 AM | #8 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
http://www.w3.org/wiki/Styling_tables Pay attention the subjects about tables/column width. Also, take in count that some properties are not applicables (so far) regarding ereader devices. But you can use anything related to table/columns width, paddings, borders, colors, etc. (no javascript and some css3 properties although some ereaders -iPad, modern Kindles- can accept them). Regards Rubén |
|
05-31-2014, 02:21 PM | #9 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Tables are not easily controllable in epub. Columns will be as wide as the largest item in the column, so you have to shrink text.
Trying to center them consistently is a ticket to insanity. When I can get it to work, it knocks out borders unpredictably. Sigil works fine and there is no reason to change. Calibre's editor will work in devices, but if you want to publish for pay it is a whole different story. You will probably have to put up with something like obnoxious epubcheck in any case. Lots of info and a lot of nitpicking stuff, but the publishers want to automate the process, that's what you have to deal with. If you aren't publishing for pay, calibre's editor is more tolerant of junky epub conversions and doesn't require everything to be good all the time. One thing about the calibre check book is you must run it over and over until it finally says no errors. |
05-31-2014, 05:15 PM | #10 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Regarding center a table, if you, for example, set a table width of 80% you can center it perfectly with a left margin of 10% or (it doesn't work in ADE) by means of margin: 0 auto;. Try this: Code:
table { width: 80%; margin-left: 10%; border: 1px solid; border-collapse: collapse; } th, td { text-align: center; padding: 5px; border: 1px solid; } .width30 { width: 30%; } .width20 { width: 20%; } .width50 { width: 50%; } Code:
<table> <colgroup> <col class="width30" /> <col class="width50" /> <col class="width20" /> </colgroup> <tr> <th>First Col.</th> <th>Second Col.</th> <th>Third Col.</th> </tr> <tr> <td>Item #1</td> <td>Table with three columns</td> <td>- -</td> </tr> </table> Last edited by RbnJrg; 05-31-2014 at 05:17 PM. |
|
05-31-2014, 05:32 PM | #11 |
Bookmaker & Cat Slave
Posts: 11,461
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
06-01-2014, 01:47 AM | #12 | |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
calibre's job is to facilitate the creation of working epubs. The epub compliance specs have (as Kovid likes to point out) nothing to do with that. Why should the calibre bundle a useless check that does not help it do its job, because the publishers insist on the placebo effect it provides, and inflict said check on everyone who uses it (creating unnecessary scares), merely to save the subset of users the effort of separately validating the book for upload to a distributor? |
|
06-01-2014, 03:38 AM | #13 | |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
Quote:
I really don't understand your(and some others) "disgust" towards epubcheck. |
|
06-01-2014, 09:49 AM | #14 | |
Well trained by Cats
Posts: 29,791
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Mostly, Less user friendly error messages. No auto-fix helper tools. Not even a Jump to error Sigil (flightcrew) Very rigid rules interpretation, but a more verbose and connects the error by a jump-to tool (in most cases) Completely fails to identify the target location of (unknown) references (usually in the OPF or NCX). There are 2(+) ends of any good reference. Or Sigil would not have known it was bad Calibre (editor) IMHO Beats Sigil in the user friendly department: Messages (really verbose) and suggested fixes (tools) Fails (the editor part) to clean a (guide) entry when deleting (unused/unwanted) files via the UI Personally, I now use both (and on occasion: the hot link to W3C's CSS validation ) |
|
06-03-2014, 06:05 PM | #15 |
New old guy
Posts: 69
Karma: 10
Join Date: Feb 2012
Device: kindle fire
|
Thanks for the suggestion --- works fine for short string data -- but falls apart when using long-strings. I need a way for the columns to adjust to fixed equal widths and for the text to wrap-around within that fixed width, no matter how long that may make that particular. Also, vertical-align:top, the other columns also stay fixed.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
EPUB 3 multi column text reading order across pages for epub | laksathish | ePub | 13 | 11-13-2018 05:18 AM |
Single column ePUB becomes 2 column when converted to Kindle (mobi) | rmcape | Conversion | 0 | 09-21-2013 12:52 PM |
Creating Sectionbreaks (i.e. defining widths) | synosure | Kindle Formats | 4 | 06-04-2010 04:22 PM |
Sideway Table in ePub (Rotate table/text) | Lapiz | ePub | 3 | 01-29-2010 01:11 PM |
EPUB Table of Contents | Acey | Calibre | 7 | 11-19-2008 11:35 AM |