View Full Version : First table row on page sometimes loses bottom margin - is this a bug?


Novelest
03-09-2012, 04:55 PM
Hello, first post here.

We're creating epubs with XSL and Ruby. I and others are seeing instances where the first table row on a page in iBooks loses its bottom margin, so the text partially overlays the text of the next row. This occurs whether the first line is first row of a table or is in a row in a table that is broken; the row can be broken across a page and it still happens. It only happens irregularly -- similar lines and rows in other locations do not show this problem. I have tried a variety of formatting on the row and on the table with CSS, but no luck. Has anyone seen this, and is there a way to prevent it (other than avoiding tables)? Or is it a bug in iBooks?

Here is a shortened HTML sample with relevant CSS entries. Would be happy to post more if it would help.

<table>
<tbody>
<tr>
<td>
<p class="last-para-in-cell">
<code class="cf ic">bind-key [key] [command]</code>
</p>
</td>
<td>
<p class="last-para-in-cell">
Creates a keybinding that executes the specified command. Can be shortened
to <code class="cf ic">bind</code>
</p>
</td>
</tr>
<tr>
<td>
<p class="last-para-in-cell">
<code class="cf ic">bind-key -r [key] [command]</code>
</p>
</td>
<td>
<p class="last-para-in-cell">
Creates a keybinding
that is repeatable, meaning
you only need to press the <code style="font-variant:small-caps" class="cf keystroke">Prefix</code>
key once, and you can press the assigned key repeatedly
afterwards. This is useful for commands where you want
to cycle through elements or resize panes. Can be shortened
to <code class="cf ic">bind</code>.</p>
</td>
</tr>
</tbody>
</table>

.simpletable {
margin-top: 1em;
margin-bottom: 2em;
border-collapse: collapse;
}

.simpletable td, .simpletable th {
text-align: left;
vertical-align: top;
padding-left: 0.5em;
padding-right: 0.5em;
}

.simpletable p.last-para-in-cell {
margin-bottom: 0pt;
}

ukzembla
05-14-2012, 09:40 AM
_______

tetragon
05-14-2012, 09:59 AM
Hi,

Having similar problems, thought using valign=top was working but it turns out iBooks fails at that too. Ditto for "page-break-inside: avoid". Not much fun.

Cheers,

Alex
tetragonpublishing.com (http://tetragonpublishing.com)

HarryT
05-14-2012, 12:04 PM
Moved to the ePub forum; you're much more likely to get help there.

Toxaris
05-14-2012, 03:23 PM
Do you encounter the same issue on ADE? If not, it is probably iBooks.