View Single Post
Old 09-10-2019, 05:48 AM   #1
kso
Enthusiast
kso began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Jun 2018
Location: UK
Device: Android, iPad, iPod, kindle {keyboard,fire7,hdx8.9} kobo, Sony PRS 600
Kindle table problem due to use of caption

I'm trying to use a very narrow table (3 columns) with a caption and I have nothing but trouble. Either the epub I'm building to be processed by Kindle Previewer 3.33 doesn't look the way it should (1st screenshot), or it does but then I have to make do without the pretty green checkmark next to "Enhanced Typesetting" (2nd screenshot).

Quote:
<table>
<caption>Short Caption String</caption>
<thead>
<tr>
<th>Amount</th>
<th>Unit</th>
<th>Item</th>
</tr>
</thead>
<tbody>
<tr>
<td>20.0000</td>
<td>Gram</td>
<td>Sugar</td>
</tr>
<tr>
<td>1.0000</td>
<td></td>
<td>Carrot</td>
</tr>
<tr>
<td>0.5000</td>
<td>litre</td>
<td>Cider</td>
</tr>
</tbody>
</table>
If I remove the caption from the table and use a span (or DIV or whatever) beneath the table, wrapping both in a DIV for the simulated caption to theoretically have the same width as the table and to share the same left margin as the centered table I get Enhanced Typesetting in the previewer 3.33 but it looks anything but enhanced: the simulated caption moves to the left margin of the page, no matter what I use (display:inline-block or block). When I add a border around the DIV containing table and caption I see that the table occupies only a fraction of the width of the page -- even on narrow screens such as an old ipod. Despite this the caption string at the bottom of the wrapping DIV is positioned outside the actual DIV.

Anyone knows how to have the caption positioned as in the 2nd image but _with_ Enhanced Typesetting on? I'd really appreciate it.

Klaus

Edit: How do you indent code when posting here? The code I fed into the form has indentation, but when I look at the posted page it's gone?
Attached Thumbnails
Click image for larger version

Name:	wrappedspan.jpg
Views:	241
Size:	3.3 KB
ID:	173361   Click image for larger version

Name:	looksOKbutNoEnhTS.jpg
Views:	246
Size:	4.8 KB
ID:	173362  

Last edited by kso; 09-10-2019 at 05:50 AM. Reason: Quoted Code lacks indentation
kso is offline   Reply With Quote