06-03-2014, 06:14 PM | #16 |
New old guy
Posts: 69
Karma: 10
Join Date: Feb 2012
Device: kindle fire
|
Yes, thank you for the tutorial article. It is excellent, but of limited value as they only use examples using short text strings/values which 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.
I know this has been addressed in many forums, including this one, but none of the tutorials or examples address all aspects. I am in the epub environment. I want a table that will adjust dependent on the ebook reader/user's choice re font size or table width. But the kicker is that the first column will hold fixed length, short reference numbers, while the remaining columns will contain long text strings (paragraphs) but adjust to equal widths -- such as column 1 set at 10% and the remaining columns setting themselves to equal widths dependent on how many columns, but all add up to 100%. Everything I have seen address the objective with a relatively non-complex code, but all assume - and the solution only works if the data going into the remaining columns is no more than the algorithm-determined width. But all fall apart if the data going into those columns is longer than the column width whereas I want an unknown amount of text (paragraphs) going into those columns. Every approach I have tried -- table-layout or not, percentages or pixels, css or html or both -- fails. Hope someone has figured out how to this -- have a solution that works with long, wrap-around text? |
06-03-2014, 08:48 PM | #17 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Have you tried SVG? It can do text as well as pictures and you can draw lines with it for boundaries.
Dale |
Advert | |
|
06-04-2014, 04:57 AM | #18 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Perhaps you could post some exemplars here, along with a) samples of the code; b) screenshots of your results, and c) screenshots or roughs of what it is you wish to achieve with the resulting final table, both before and after a font-size-change. Maybe I'm going bonkers, but I'm pretty sure that we make tables with adjustable size columns with wrapping text pretty darned often. So: can you help us out with more details, as requested? To be sure we're all on the same page? Hitch |
|
06-07-2014, 03:46 PM | #19 |
New old guy
Posts: 69
Karma: 10
Join Date: Feb 2012
Device: kindle fire
|
Thank you all for your ideas, suggestions, tips. This turned out to be an extensive exercise with hours of trial-and-error.
But, I have finally created a skeleton CSS/HTML that works for me -- works regardless of eReader/User's choice of font/page width, and editor's choice of number of columns and choice of column width -- and lets me use a caption or not, assign number of columns and assign column widths directly from the html text without any changes to the css. Just two remaining "needs". I have not found a way to have different text alignments for any column (i.e., left or center for column 1 and justify for column 2) and I have not been able to implement auto hyphenation for text columns. <table class="table1" width="80%"> <caption></caption> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <td width="20%"></td> <td width="20%"></td> <td width="20%"></td> <td width="20%"></td> <td width="20%"></td> </tr> </table> .table1 { margin:auto; border:1px solid black; font-size:12px; border-collapse:collapse; } .table1 caption { font-size:140%; font-weight:bold; font-style:Italic; } .table1 th { border:1px solid #000; background-color:grey; color:white; font-weight:bold; border:1px solid black; padding:10px; } .table1 td { vertical-align:top; text-align:justify; border:1px solid black; padding:10px; } |
06-07-2014, 05:32 PM | #20 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Also, n.b.: any table with more than 4 columns starts to be seriously problematic in ANY reader; but that's not directly related to your issue. I thought I'd mention it to you, however. Hitch |
|
Advert | |
|
06-08-2014, 02:48 AM | #21 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
|
06-08-2014, 05:30 AM | #22 |
New old guy
Posts: 69
Karma: 10
Join Date: Feb 2012
Device: kindle fire
|
Well, I don't know what to say. I guess from what you say, I might be in trouble if I use some other viewer. But for now, its only for me and I only have the calibre viewer and my Kindle Fire and all is well -- the font adjusts proportionally to the user's changes as do the table themselves; in fact, I have one table that is 10 columns and the font can get so small it is not readable, but I can put the Kindle on its side and the table and font will change to the larger width. I don't pretend to understand what's going on or why this particular coding works for me -- it was created by trying virtually every combination of rules I could think of until I hit upon one that did what I want. Its very frustrating to see so many rules producing different results when used in the presence of some other seemingly unrelated rule.
Now I am going through the same try-fix-try process to find a set of rules for having different text alignment for each column and hyphenation. I study all examples I can find and follow the instructions carefully but have not found a set of rules that reliably produce the desired results. |
06-08-2014, 04:50 PM | #23 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
Yeah, I can understand, Hitch is the boss when it comes to ranting about those things
In any case, I don't see why a simple CSS rule for alignment wouldn't work on a table cell or a table row if you use the class properly. |
06-09-2014, 01:11 AM | #24 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
If you use a fixed font size, like 12px, you will not be able to use another font size on (most?) readers.
|
06-09-2014, 04:34 AM | #25 |
Obsessively Dedicated...
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
@Weberr -- I don't know if this is what you are looking for for text alignment, but this works for me. I set the alignment in the individual cells. (I have never worried about hyphenation and let the app/device worry about it instead.) I don't set a fixed font size, and only use relative font-sizing, ie, 80% or .8em.
Of course, I only work with fiction, so my needs are very simple. This is what I used recently, with an embedded monospace font (it is a bit more attractive than the default reader font). Sample css code Spoiler:
sample HTML Spoiler:
This is a very simple three-column table with no borders. The middle column is just to provide more spacing between the text and the numbers. Last edited by GrannyGrump; 06-09-2014 at 04:42 AM. |
06-10-2014, 07:35 AM | #26 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
The way to get the alignments as you like is to tediously provide the alignment for every single cell, as is shown by GrannyGrump. You'd think it would be easier but after get set up to do it, it isn't so bad and it is gratifying to see it finally work after trying everything else.
|
06-12-2014, 11:59 AM | #27 | |
Resident Curmudgeon
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
06-12-2014, 12:08 PM | #28 |
Resident Curmudgeon
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But don't forget, if you are not using a fixed size for the font in the table, don't forget to increase the font size to see when things will break and they probably will break with a large enough font.
|
06-12-2014, 04:42 PM | #29 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
The calibre viewer is a terrible test for existing devices. It shows working things that will fail in many devices. It is not designed to be any sort of test, but a convenience for looking through material you have stored in your library.
|
06-12-2014, 07:50 PM | #30 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Did he say he was using Calibre somewhere? I missed that? Hitch |
|
|
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 |