08-28-2020, 04:00 PM | #1 |
Bookaholic
Posts: 11
Karma: 93748
Join Date: Aug 2020
Location: Barcelona area
Device: Kindle Paperwhite
|
Show tables in a reading device
I have used CSS tables to arrange a set of numbers as a matrix of rows and columns after converting a book from pdf to epub. The table was completely messed up in the pdf document.
The tables in the epub book look nice in Sigil and Calibre but they don't render well in my Kindle. I'd like to know if there is a better strategy to show those tables, though it's obvious that the ebook screen size sets a limitation on the number of columns. Do you people have any recommendation? |
08-28-2020, 04:43 PM | #2 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Have you tried pure a html table?
|
Advert | |
|
08-28-2020, 04:47 PM | #3 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
HTML tables have worked for me. With a little CSS to add borders, center headings, etc.
|
08-28-2020, 05:03 PM | #4 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Here is the CSS I use for HTML tables. The last 4, coltwonum (column two, numeric) etc. are for columns where it's decimal numbers, e.g., 2.34, to force right alignment so that the decimal points line up. tr.final is for a row where the values are a sum of the columns.
Code:
table { margin-left: auto; margin-right: auto; border-collapse: collapse; margin-top: 1em; } table caption { font-weight: bold; padding-bottom: 0.5em; } td { border: 1px solid currentColor; empty-cells: show; padding: 0.125em; text-align: left; } tr.final { border-top: 2px solid currentColor; } table.coltwonum td:nth-child(2) { text-align: right; } table.colsthreenum td:nth-child(3) { text-align: right; } table.colfournum td:nth-child(4) { text-align: right; } table.colfivenum td:nth-child(5) { text-align: right; } |
08-31-2020, 04:29 PM | #5 |
Bookaholic
Posts: 11
Karma: 93748
Join Date: Aug 2020
Location: Barcelona area
Device: Kindle Paperwhite
|
Code:
I have tried this approach: #table1 { width: 60%; } #table1 td,th { padding-top: 8px; text-align: left; } #table1 td + td, #table1 th + th { text-align:right; } |
Advert | |
|
08-31-2020, 06:22 PM | #6 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Which version of Kindle? Basic Tables work with Kindle 8 azw3 style ebooks. It sounds like you are trying with an older mobi style Kindle device?
How are you converting it to Kindle (mobi 6 format, mobi 8 format, or joint)? What does Kindle Preview show? Last edited by KevinH; 08-31-2020 at 06:27 PM. |
09-01-2020, 03:35 PM | #7 | |
Bookaholic
Posts: 11
Karma: 93748
Join Date: Aug 2020
Location: Barcelona area
Device: Kindle Paperwhite
|
Quote:
I converted epub to mobi 6 and also to azw3 with Calibre 4.23. Preview in Calibre was ok but on the Kindle device the table was misaligned and looked ugly. |
|
09-01-2020, 08:15 PM | #8 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
mobi6 is old and does not support tables but mobi8 (azw3) shoukd be fine. Please load your epub (not mobi6 - but actual epub) into the KindlePreview app and tell us what you see?
|
09-04-2020, 03:53 PM | #9 | |
Bookaholic
Posts: 11
Karma: 93748
Join Date: Aug 2020
Location: Barcelona area
Device: Kindle Paperwhite
|
Quote:
The epub looks fine on it, exactly as intended. Now, if I convert it to mobi or azw3, whether using Calibre or an online converter, the tables become disrupted. |
|
09-04-2020, 04:09 PM | #10 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Can you post a sample table and your css? I tried it and it works fine on my Kindle Touch; I created a dual Mobi with Kindlegen, which contains both the old MobiPocket format as well as the AZW (not sure what version of AZW), although the Touch uses the AZW, not the MobiPocket.
|
09-04-2020, 04:12 PM | #11 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Just convert to mobi8 (azw3) using KindlePreviewer/Kindlegen app itself. It is doing that internally to show you the epub. Then try loading the mobi8/azw3 into your device. Keep calibre out of the conversion process completely for this test. My guess is a calibre’s conversion setting might be influencing the output.
Some online converters just use calibre behind the scenes and not the latest Kindlegen. Last edited by KevinH; 09-04-2020 at 04:15 PM. |
09-09-2020, 04:00 PM | #12 |
Bookaholic
Posts: 11
Karma: 93748
Join Date: Aug 2020
Location: Barcelona area
Device: Kindle Paperwhite
|
@KevinH: you're right, I did as you suggested and 2 out of 3 tables look good on the device, the one that doesn't has 8 columns which I guess is a bit too many for the limitted space available -even if I use my Kindle in landscape mode.
@hobnail: below are my test tables and styles, in case you feel like playing around with them. TABLES: Spoiler:
Last edited by theducks; 09-09-2020 at 09:07 PM. Reason: wrapped long code in spoiler |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Lg g6 is my reading device any suggestion for app reading | ant_gamal | Android Devices | 0 | 12-29-2017 05:16 AM |
Show off your reading layout | MeSue | Marvin | 14 | 09-13-2013 01:25 AM |
Show location on device? | BookJunkieLI | Calibre | 4 | 04-22-2013 09:23 AM |
iBooks: pictures do not show in tables | georg3200 | ePub | 32 | 05-20-2011 03:05 AM |
Reading PhD theses with formulae, figures and tables | ktakeda | Sony Reader | 36 | 12-04-2008 09:02 PM |