MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   CSS/HTML question (https://www.mobileread.com/forums/showthread.php?t=186350)

ElMiko 07-28-2012 11:49 AM

CSS/HTML question
 
1 Attachment(s)
I'm trying to duplicate the effect where a heading has some text justified to the left followed by some blank space, and then some text justified to the right, all on the same line (see circled area on attached image).

My instinct would be to create a single-row table with two cells. However, I know that pre-KF8 mobi files struggle with tables (I don't know how well KF8 deals with them). My question then is this: is there another way to achieve that formatting effect, and if not, does anyone know how well a KF8 conversion from epub in Calibre renders tables (for display on a Kindle device). I realize this is a little convoluted...

mmat1 07-28-2012 12:22 PM

1 Attachment(s)
Quote:

Originally Posted by ElMiko (Post 2166440)
My instinct would be to create a single-row table with two cells. However, I know that pre-KF8 mobi files struggle with tables .

How's this ??

No guarantee that it will work on a mobi, but an alternative to a table

ElMiko 07-28-2012 12:41 PM

@mmat1 - veddy veddy clever. Thanks for that. I'm going to play around with that and the table option and see how they convert and render on a Kindle. FWIW, the KF8 conversion viewed through calibre's reader rendered just fine.

JSWolf 07-28-2012 01:05 PM

Quote:

Originally Posted by mmat1 (Post 2166459)
How's this ??

No guarantee that it will work on a mobi, but an alternative to a table

The ePub didn't work. One side was a line above the other.

ElMiko 07-28-2012 01:31 PM

Quote:

Originally Posted by JSWolf (Post 2166493)
The ePub didn't work. One side was a line above the other.

weird....worked fine with me... Not only that, but it rendered perfectly on the kindle, even when the table wouldn't. What viewer were you using that made it render incorrectly? did you make any additions to the text?

PeterT 07-28-2012 01:34 PM

Didn't work for me either in ADE; the right hand side seems to be a line above the left hand side.

Jabby 07-28-2012 01:39 PM

I tried Mantano reader and it failed - right above the left.

Sure would like to see a solution to this problem.

Regards - John

PeterT 07-28-2012 01:45 PM

Does this idea help? http://css-tricks.com/left-align-and...the-same-line/

jbacelar 07-28-2012 02:01 PM

1 Attachment(s)
This works fine in ADE
Attachment 89841

mmat1 07-28-2012 02:06 PM

Quote:

Originally Posted by ElMiko (Post 2166524)
weird....worked fine with me... Not only that, but it rendered perfectly on the kindle, even when the table wouldn't. What viewer were you using that made it render incorrectly? did you make any additions to the text?

Sorry ...

It seemes to work well for me but i didn't check it fully. I got the same results with ADE as the others.

You should give PeterT's suggestion a try ...

ElMiko 07-28-2012 02:17 PM

1 Attachment(s)
Interesting... none except mmat's seems to render as intended in Sigil (or consequently in Calibre). likewise, the mobi/KF8 conversions don't render correctly. It seems you can either design the epub to display correctly in calibre (and its KF8 conversion to render correctly on Kindle), or you can design it to render correctly on ADE, but not both.

EDIT: Wrote bad code... got bad result. GIGO. ignore this post

mmat1 07-28-2012 02:19 PM

1 Attachment(s)
Quote:

Originally Posted by jbacelar (Post 2166555)
This works fine in ADE
Attachment 89841

sorry, but I get bad results on browser-based renderers.

this seams to be the solution, following the advice given by PeterT's link

(Tested with ADE ;) )

mmat1 07-28-2012 02:25 PM

Quote:

Originally Posted by ElMiko (Post 2166560)
@ ElMiko

you misspelled the classname in your sample: "alightright"

a light right ?? :)

ElMiko 07-28-2012 02:30 PM

You're all rockstars. thanks for the help.

@mmat- yeah, i just figured that out myself.... feeling pret-tee dumb.

for the record, renders poifectly on a Kindle, using calibre's KF8 conversion.

JSWolf 07-28-2012 03:27 PM

Quote:

Originally Posted by ElMiko (Post 2166524)
weird....worked fine with me... Not only that, but it rendered perfectly on the kindle, even when the table wouldn't. What viewer were you using that made it render incorrectly? did you make any additions to the text?

Same as PeterT. I used ADE for Windows to view it. I did have a look at the code and I did notice that each header was supposed to be on a separate line as they both used paragraph level coding.


All times are GMT -4. The time now is 07:54 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.