Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-08-2011, 03:23 PM   #1
SoftwareManiac
Member
SoftwareManiac began at the beginning.
 
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 so it is very hard to visually detect that the multicolumn text is actually a table. I've tried all sorts of thing like changing the border-width and style as well as using a single border definition of border: 1px solid black; and yet nothing seems to work!

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?
SoftwareManiac is offline   Reply With Quote
Old 06-08-2011, 04:28 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by SoftwareManiac View Post
Do you all have any suggestions as to what table CSS settings can give me a table border?
Kovid posted in February of this year that as far as he knew, mobi doesn't support table borders. Are you sure you are seeing borders on mobi tables?

http://www.mobileread.com/forums/sho...34&postcount=2
Starson17 is offline   Reply With Quote
Old 06-10-2011, 09:38 AM   #3
SoftwareManiac
Member
SoftwareManiac began at the beginning.
 
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
SoftwareManiac is offline   Reply With Quote
Old 06-10-2011, 10:20 AM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by SoftwareManiac View Post
So, by your comment, it appears that calibre drops any border style definitions during a .mobi conversion, correct?
I don't use mobi and have no information about it, other than I've seen numerous threads on tables and mobi. All the info I've seen until now has been that mobi doesn't support table borders. Your post is the first I've seen saying the opposite. I can't tell you much more than that. Mobileread has a Wiki on mobi format, but there's not much info there.
http://wiki.mobileread.com/wiki/MOBI#Format_limitations

Can you open the mobi to see how the border is defined?
Starson17 is offline   Reply With Quote
Old 06-10-2011, 10:26 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,419
Karma: 4961459
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
kovidgoyal is offline   Reply With Quote
Old 06-10-2011, 10:34 AM   #6
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
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.
Starson17 is offline   Reply With Quote
Old 06-10-2011, 04:18 PM   #7
Grey Ram
Member
Grey Ram began at the beginning.
 
Posts: 11
Karma: 10
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:
<table border="1" align="center">
<tr align="center">
<th rowspan="2">
<small><i>Número<br/>de la<br/>estrella</i></small>
</th>
<th colspan="2">
<small><i>1a coordenada</i></small>
</th>
<th colspan="2">
<small><i>2a coordenda</i></small>
</th>
</tr>
<tr align="center">
<th>
<small><i>observada</i>
...
The resulting table looks like the attached image.

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.
Attached Thumbnails
Click image for larger version

Name:	Kindle Table.png
Views:	300
Size:	63.3 KB
ID:	72606  
Grey Ram is offline   Reply With Quote
Old 06-10-2011, 04:40 PM   #8
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Grey Ram View Post
I have produced a table with borders by hand editing html and using Mobipocket Creator with the following code
Do you see any difference with the border attribute set to more than 1? Does the border disappear if you remove the border attribute?
Starson17 is offline   Reply With Quote
Old 06-10-2011, 06:28 PM   #9
Grey Ram
Member
Grey Ram began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2011
Device: Kindle 3
Tables with borders

Quote:
Do you see any difference with the border attribute set to more than 1? Does the border disappear if you remove the border attribute?
Hi again

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
Attached Thumbnails
Click image for larger version

Name:	Kindle table 4.png
Views:	209
Size:	46.0 KB
ID:	72612  

Last edited by Grey Ram; 06-10-2011 at 07:00 PM. Reason: some more testing
Grey Ram is offline   Reply With Quote
Old 06-12-2011, 08:20 PM   #10
SoftwareManiac
Member
SoftwareManiac began at the beginning.
 
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? ;-)
SoftwareManiac is offline   Reply With Quote
Old 06-13-2011, 07:59 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,419
Karma: 4961459
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.
kovidgoyal is offline   Reply With Quote
Old 06-13-2011, 08:50 AM   #12
SoftwareManiac
Member
SoftwareManiac began at the beginning.
 
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!
SoftwareManiac is offline   Reply With Quote
Old 06-24-2011, 08:56 AM   #13
SoftwareManiac
Member
SoftwareManiac began at the beginning.
 
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
SoftwareManiac is offline   Reply With Quote
Reply

Tags
indesign, mobi, tables

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 10:46 PM.


MobileRead.com is a privately owned, operated and funded community.