|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Member
![]() Posts: 16
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
Getting table borders to work with calibre - Amazon's .mobi format (from InDesign):
Using Amazon's Kindle PlugIn (KPI) v.92 a single-cell Note paragraph has a nice border!
Not sure you all can help me, but I am using some other tools to generate tables in .mobi format that you all support. I can't seem to get tables to render correctly and I think my understanding of how .mobi supports tables is incomplete. Using InDesigns Export to EPUB feature and calibre to conver the .epub file to .mobi generates a similar table but without any borders! In fact, any table I attempt using these tools never seems to be able to create any borders. <table id="table-5" class="Note-Table"> <tbody> <tr> <td> <p class="Note-Body"><span class="BOLD-1">Note: </span>This is a note that should stand out and reside in a single table cell with a gray background. Hopefully this will have some sort of standoff from normal text. Usually a caption does not follow a Note Table.</p> </td> </tr> </tbody> </table> In the template.css I made some simple changes (bolded) that should work, but instead the .mobi file does display the dark gray text color and the changed top and bottom margins (from 0 to 1em) as expected. The border style definitions are simply ignored (border:1 ![]() table.Note-Table { border-collapse : collapse; border-style : solid; border-width : 2px; border-color : #000000; margin-top : 1em; margin-bottom : 1em; } p.Note-Body { font-family : Arial, sans-serif; font-weight : normal; font-style : normal; font-size : 0.71em; text-decoration : none; font-variant : normal; line-height : 1.2; text-align : left; color : #202020; text-indent : 0px; margin : 1em; } I have reviewed the v1.8 Kindle Guidelines and there appears to be no <table>, <td>, or any other definition specified so I am "guessing" how to create the HTML and corresponding CSS to work. My goal is to somehow come up with the right CSS code that allows me to put borders around the table and cells. I realize that using calibre to convert from .epub to .mobi may be at risk, but I think the conversion is pretty straightforward. Other feedback I've gotten from other forums indicate that .mobi is such an old format that I'll never get tables to look good -- I don't believe that since I have already proven that KPI produces tables with borders that look great! Do you all have any suggestions as to what table CSS settings can give me a table border? |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
https://www.mobileread.com/forums/sho...34&postcount=2 |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 16
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
Yes, in fact, I took the Amazon Kindle Indesign plugin .mobi file from one of my InDesign documents and used calibre to convert it back to .epub. I got something like this:
<table border="3" class=.calibre33> text ... The .calibre33 style definition has no special border info, just the inline <table> tag you see above. I can post either a screen capture or the .mobi file that the KPI v.92 produces if you'd tell me where to send it. So, by your comment, it appears that calibre drops any border style definitions during a .mobi conversion, correct? thanks, Ken |
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
https://wiki.mobileread.com/wiki/MOBI#Format_limitations Can you open the mobi to see how the border is defined? |
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
MOBI does not support table borders as far as I know and as per the MOBI pocket documentation
http://www.mobipocket.com/dev/articl...ile=tables.htm |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
From the original post, where it said the border was on a single cell table, I suspected it was just a framed paragraph he was seeing, not a bordered table. That's why I asked if he was sure he had a table border. MOBI supports framed paragraphs, as per Kovid's link.
|
![]() |
![]() |
![]() |
#7 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33
Karma: 2146058
Join Date: May 2011
Device: Kindle 3
|
Table using Mobipocket Creator without CSS
Hi
I don't use InDesign, but I have produced a table with borders by hand editing html and using Mobipocket Creator with the following code Quote:
I have tried using css with Mobipocket Creator, but the support is not very good and the support for tables is even worse. Anyway, I hope you find this helpful. |
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
![]() |
#9 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33
Karma: 2146058
Join Date: May 2011
Device: Kindle 3
|
Tables with borders
Quote:
I've been doing some testing. The border disappears if I set border="0" or if I remove it, the width does increase with other values; see the image for border="4" But it is kind of flakey, kindle previewer choked on the chapter with the table once, and I had to restart my kindle too during my tests (probably has to do with rewriting the same file over and over, but I'm not sure). EDIT: one more note, with border="4" Kindle for Mac displays double thin lines instead of a thick solid one, and at border="5" the table disappears altogether. It shows ok on the Kindle though. cheers Last edited by Grey Ram; 06-10-2011 at 07:00 PM. Reason: some more testing |
|
![]() |
![]() |
![]() |
#10 |
Member
![]() Posts: 16
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
Thank you. Yes, perhaps it is the CSS that is broken. I can go in and patch the <tables> to include a border attribute -- not a good way to go, but I'll let you all know. Hopefully a new version of calibre can fix that? ;-)
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The border attribute is no substitute of CSS table borders. border basically controls only the presence or absence of a border.
|
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 16
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
Ok - so based on my initial post. I use InDesign's EPUB Export feature to produce an .epub. Uncompressing the .epub I adjusted the CSS definitions to include what should have produced a table border:
border-style : solid; border-width : 2px; I tried all sorts of other CSS border definition combinations. None of them worked. Thanks to Grey's comments I did the unthinkable and added the border="1" to all the <table> occurrences in my HTML source document tag and re-compressed into a new .epub file. I ran it back through calibre to convert to .mobi and voila! It worked. Every table now has a border (including each cell). If I am missing a statement that I should put into my .css definition instead please let me know (I tried the "border : 1px solid black" and other variations), please let me know. This is a kludge, but at least it makes tables look like tables again! |
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 16
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
Thank you guys! You all fixed it in 0.8.6. Next week I am definitely donating a wad of loot to the cause. I am extremely happy!
Software Maniac author of Indesign to Kindle Seattle, WA |
![]() |
![]() |
![]() |
Tags |
indesign, mobi, tables |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Table Generation loses borders (.mobi conversion) | SoftwareManiac | Conversion | 5 | 05-27-2011 11:32 AM |
Calibre and mobi format - creating a paige or location specific table of contents | coaver | Conversion | 2 | 01-25-2011 05:22 AM |
perseving table format when converting PDF to Mobi | jimbbq | Calibre | 1 | 09-24-2010 12:28 PM |
preserve table format when converting mobi to rtf | moogoogai | Calibre | 4 | 02-26-2010 12:50 PM |
[Calibre]Table des matiere .mobi ? | androgyn3 | Software | 14 | 01-13-2010 09:46 AM |