View Full Version : Help! Problem with HTML tables in epubs

06-05-2013, 02:23 AM
Hello everyone, I'm a newbie here so please be gentle :P.

I use Sigil to create epubs for my books, which I then upload to Google Play Books and read on my Nexus 7. Everything was going well until I had to insert a two-column table.

Here is the CSS stylesheet I used for the table:
td.colw {width: 50%; vertical-align: text-top;}

And here is the HTML code for the table within the page:
<table border="1" cellpadding="3" width="100%">
<td class="colw"><i>DUMMY TEXT</i></td>

<td class="colw"><i>DUMMY TEXT</i></td>
<td class="colw">THIS IS A REALLY LONG TEXT.</td>

<td class="colw"></td>

Now, the problem is that even though everything displays fine, if there is a long piece of text in one of the columns, instead of the column splitting and the remaining text flowing to the next page from that point, the entire column is moved to the next page, leaving a lot of white space below the last column in the previous page (please refer to the 2 attached images), which looks quite ugly.

My question is, is there some code which I can incorporate which makes table column text flow just like normal text and the column 'cuts' to the next page rather than completing moving itself there? Or is this is a problem with epubs which cannot be solved as of now?

Thanks in advance :)



06-05-2013, 04:17 AM
You mean that the whole row (not column) is moved to the next page? I don't think you can do anything about that, that's reader-dependent, and some will have the other behaviour and cut the text even in the middle of a line. Using tables in ebooks is looking for problems.

06-05-2013, 08:37 AM
Using tables in ebooks is looking for problems.

Unfortunately true after fighting and fighting it and is true in ADE based books too. If it has to be laid out a certain way you are better off with an image of the table. But the image may be smaller than you want.

Since text can get bigger, the table must be bigger and it can get bigger beyond all reason.

06-05-2013, 11:15 AM
Thank you for your replies, and yes sorry - I meant rows, not columns.

I tried opening the same epub in some other e-readers like Moon Reader, Cool Reader, FB Reader, Aldiko and each reader has its own quirkiness in rendering the same table. Moon Reader (although a great reader), for example, just completely ignores the table and clumps all the text together :D

Ah well, I guess I'll just have to live with this small annoyance for now. Converting the tables to images is tricky when porting on to different sized devices. Maybe future versions of the programs will better address this situation.