View Full Version : Need help with table in ADE


robach
11-13-2011, 07:55 PM
Hello.

I have to show 2 images with their captions.

One image has to be aligned to the right with his caption at his left side and vertically aligned to the bottom line of the image.
The second image has to be aligned to the left with the caption at his right side also vertically aligned to the bottom line of the image.

I tried to make it with 2 tables, and the result is OK in Sigil and iBooks, but in ADE the second table displays the caption out of limits.

In the images I've uploaded you can see that in ADE the first table displays the two cells OK, but in the second table something goes wrong and cells aren't displayed as I want.

Can someone open my eyes? Is there a better way for doing it?

I've also uploaded the epub.

Thanks.

pholy
11-14-2011, 12:11 AM
Did you notice that the borders around Img2 don't look the same as around img1? When I am more awake I will change the size classes to have different border styles to see more clearly what is happening. It looks like the 100% image width over-rode the 55% cell width.

You may have an example of one (more?) of the ADE bugs noted in the sticky thread here.

BTW, on my BeBook the images are on different pages, perhaps due to the blank status line at the bottom of the screen.

robach
11-14-2011, 04:33 AM
Hello pholy.

Thanks for your time.

Did you notice that the borders around Img2 don't look the same as around img1?

Yes. That's the reason I used borders for the cells, to see what's wrong.


It looks like the 100% image width over-rode the 55% cell width.

But this doesn't happen in the first table with the image in the right cell. Also, if I define the second table as the first one (with the image at the right side) it's displayed OK.


You may have an example of one (more?) of the ADE bugs noted in the sticky thread here.

BTW, on my BeBook the images are on different pages, perhaps due to the blank status line at the bottom of the screen.

It's very fun to have to put extra code to make the books look good on all platforms.

Ricard

Jellby
11-14-2011, 05:53 AM
Why do you "have" to do this? It's not a good format for an ebook.

robach
11-14-2011, 07:06 AM
Why do you "have" to do this? It's not a good format for an ebook.

That's why I'm here asking...

...and as I said...

Is there a better way for doing it?

Thanks Jellby.


Ricard

Jellby
11-14-2011, 08:44 AM
I would just put the caption before or after the image, and wrap both in a block with "page-break-inside: avoid" to disencourage the reading system from inserting a page break between image and caption (but not really prevent it).

If the caption is very long, I'd even insert pagebreaks before and after both caption and image, like in Kipling's Just So Stories. Basically you find a page with only the caption ("The following illustration shows this and that..."), then a page with only the illustration to its full glory, then the story continues.

robach
11-14-2011, 10:18 AM
Thank you Jellby.

I'll do it as you recommend. I was only trying to make it as similar as possible to the original.


Ricard

pholy
11-14-2011, 04:10 PM
After changing the border styles in your test, I am convinced you have found a bug in the ADE engine. Note that in the attached picture the solid lines look slightly dotted - this is due to dithering to try to make the line look blue. When I changed the colour to #000000 it looks exactly right - the lines, not where they are.

In the picture you can see that the first data cell border (dashed) extends beyond the table border, and the second cell borders (dotted) start within the table and extend beyond the table and beyond the first cell border.

To me, that's a bug, not a feature.

It gets really weird if you remove the "width=100%" from the image spec, by the way --- another bug, I think.
Edit: Oh, RE no width: I think the size of the image is controlling the size of the its cell, leaving little left for the other cell.

Basically, there is an interaction in the handling of tables and images, which is handled poorly.

robach
11-14-2011, 05:30 PM
Hello pholy.

As I said in my last post, I've given up the idea.

I wanted to respect the original design, but now I'm convinced that it wasn't a good idea.

Perhaps it's an ADE bug (iBooks and Sigil show it OK), but I prefer not to have any trouble. I'll make it safer, one image per page with caption below.

Thanks for your time.

Ricard

EDIT:
Edit: Oh, RE no width: I think the size of the image is controlling the size of the its cell, leaving little left for the other cell.

But have you noticed that if you put the image in the second cell (the one at the right) with the same 56% size, it doesn't happen?