View Single Post
Old 09-15-2013, 05:29 AM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,556
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The problem here is that you need to have a container whose width adapts to its contents. Normal block elements (<p>, <div>) are no good, it is their contents that adapt to their width, and no the other way around. But tables behave like that, so you you could use Rubén's trick with "display:table" (though I'm not sure how that interacts with long lines).

However, when it comes to centering such an element, you need to use "auto" margins. "align:center" does not work, because it controls the alignment of whatever is inside, not the positioning of the element itself. "align:center" in the parent element does not work either, because the table is a block-like element, which does not obey the align attribute. And this is when we find that "auto" margins are explicitly optional in the ePub specification, and ADE choses to ignore them (or rather set them to 0). I'm afraid there's no solution for this.
Jellby is offline   Reply With Quote