|
|
#1 |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
CSS being ignored -- looking for workaround
I have a book containing tables containing rows that have this rule:
Code:
tr {
vertical-align: top;
}
Similarly, I have another book with inline tables subject to the following rules: Code:
table {
display: inline-table;
vertical-align: middle;
}
Can anyone suggest a workaround to allow me to fix these alignment issues? Last edited by Phssthpok; 06-27-2026 at 04:27 AM. |
|
|
|
|
|
#2 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 837
Karma: 2111023
Join Date: Sep 2013
Device: Kobo Sage
|
I don't know what you're using to edit the books. But in Calibre's Editor, you can use the Live CSS tab in the File Preview pane (at least, that's where it is on my system) to see what might be overriding your CSS:
https://manual.calibre-ebook.com/edi...live-css-panel Hopefully, that'll give you a starting point to figure out what's happening. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
It seems the problem is down to the rendering engine used for EPUBs. It seems to ignore vertical-align rules for table elements. If I convert to KEPUB, it works fine.
However, the displayed font size is now about half what it was when the book was an EPUB, too small to read. If I change the font size so it's readable, EPUBs come out as "font-size: bloody-enormous". Is there a way to set display defaults for KEPUBs separately for those used for EPUBs? Or do I have to convert all my books (8700+) from EPUB to KEPUB and re-upload them all? Or (plan B) find all the books affected by this problem (a dozen or so) and add "body { font-size: 2em }" to each of them... Last edited by Phssthpok; 06-28-2026 at 01:10 PM. |
|
|
|
|
|
#4 | |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
Last edited by Phssthpok; 06-28-2026 at 01:08 PM. |
|
|
|
|
|
|
#5 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52,778
Karma: 180988364
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
There is a patch called Unify Font sizes which makes the font size come close to matching between the two renderers. I would also suggest the My 10 Line Spacing Value patch which allows matching the line height for kepubs closer to the one use for epubs.
The Kepub rendering engine is ePub3 and understands the ePub subset of CSS3 while the RMSDK rendering engine is ePub2 and supports very little CSS3. |
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
I tried using Calibre's conversion dialog: in Look & Feel I unchecked "disable font size rescaling" and set "Font size key: 18.0" but it had no apparent effect. Where can I find the patches you mentioned? |
|
|
|
|
|
|
#7 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52,778
Karma: 180988364
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Vertical align for tables was introduced in CSS2 but use of all the properties wasn't until CSS3. This allowed replacing the valign attribute according to my vague memories.
For firmware 4.38.23697, check the Patches for Firmware 4.38.23697 thread. You can also check the KoboPatch WebUI: customization (NickelMenu, KOReader) and patching via your browser for an alternate approach to patching. |
|
|
|
|
|
#8 | |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
So now in addition to the CSS I have a valign attribute -- belt & braces. If the deprecated valign is ignored, the CSS vertical-align will do the job. And primitive renderers which ignore vertical-align in tables will be primitive enough to honor the valign attribute. And lo, it works -- except that for the book with inline tables, adding valign=middle to the table element has no effect. Oh well, in that one case I'll have to convert to KEPUB and somehow fix the font size. Thanks for the links! |
|
|
|
|
|
|
#9 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83,967
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
td {
vertical-align: top;
}
|
|
|
|
|
|
|
#10 | |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
Meanwhile I'm banging my head against the inline-table problem. Converting to KEPUB requires me to insert body { font-size: 2em } when converting from EPUB, but then various other funnies show up: italicised text is also bold, and hyperlinks are underlined despite being styled with text-decoration: none. Editing the KEPUB with Calibre, it looks fine and everything has the stylings I specified, but the Kobo knows better! Aaaargh! |
|
|
|
|
|
|
#11 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83,967
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
You need to install the patch that makes the font sizes the same for KePub and ePub.
|
|
|
|
|
|
#12 |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
|
|
|
|
|
|
#13 |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
I solved my inline table problems by replacing the tables with spans having display: inline-block and a suitable vertical-align, then used block elements inside those for the table rows. So I can avoid using KEPUBs altogether, which saves me a lot of hassle.
|
|
|
|
|
|
#14 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83,967
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The patch to make KePub and ePub font sizes the same have nothing to do with CSS. It's to do with the system software being patched.
Last edited by JSWolf; Yesterday at 12:12 PM. |
|
|
|
|
|
#15 |
|
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 638
Karma: 95237
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
What I thought. It seems KEPUBs fix some problems but then have a whole different set of issues, so I think I'm best off avoiding them. But thanks for all the advice and guidance.
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sigil CSS parser will not understand the new nested CSS | KevinH | Sigil | 12 | 04-12-2026 03:05 PM |
| Method to Convert Fancy CSS to Everyday CSS? | enuddleyarbl | ePub | 25 | 07-25-2022 02:07 PM |
| Customize viewer css. pygments.css not found | drglenn | Viewer | 2 | 12-18-2020 04:52 PM |
| pagestyle.css extra / integrated in stylesheet.css / or not at all? | chaot | Workshop | 14 | 02-24-2017 11:10 PM |
| css pseudo elements and adjacent combinators in extra css? | ldolse | Calibre | 2 | 12-21-2010 05:09 PM |