Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-22-2010, 01:15 PM   #1
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
Correctly Aligning Text Within a Table

I hope someone can give me some clues on how to do this as I've been tearing my hair out trying to figure it out.

I've got quite a few plays in epub form but the formatting seems to have gone astray.

All the text is in the form of tables so as to properly separate the speaker from what is spoken.

e.g.
Code:
<table>
    <tr>
      <td>person 1:</td>

      <td>"Blah, Blah, etc, etc, and so on."</td>
    </tr>
</table>
Now this seems to appear fine if the spoken text is quite short, but if they are saying alot and the text wraps on the screen, then the first cell seems to becomes centred in a vertical alignment.

What I want is for the first cell to have the text at the top of the cell so as to make it easier to see where the speaker starts.

e.g.

Code:
Person: "Blah, blah, blah,
             blah, blah, blah,
             blah."
and not

Code:
             "Blah, blah, blah,
Person: blah, blah, blah,
             blah."
I'm sure it would be possible to play around with this so solve this for a single device, but I'm going to reading them on device with different screen sizes. i.e. PRS-600, Desktop PC with a 17" screen, Laptop PC with a 15" screen.

So what I'm looking for is a solution that is screen/resolution independant.

Any help would be most appreciated.
ghostyjack is offline   Reply With Quote
Old 07-23-2010, 06:47 AM   #2
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,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
You want to use "vertical-align: top" or similar, I guess.

But please avoid using tables when not absolutely necessary, they are a sure source of problems and headaches. In your case, it could probably be enough to use hanging indents (a left margin for the paragraph and negative indent for the first line).
Jellby is offline   Reply With Quote
Advert
Old 07-23-2010, 07:49 AM   #3
Worldwalker
Curmudgeon
Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.Worldwalker ought to be getting tired of karma fortunes by now.
 
Posts: 3,085
Karma: 722357
Join Date: Feb 2010
Device: PRS-505
Caveat: I don't know jack about the innards of an epub, other than that it's built of XHTML and CSS. What I am, however, is a website designer, and the crazy kind who hand-codes everything at that, so I can sort out your code problems. At least, I can in the context of them being a web page; I don't know whether my answers are appropriate for your situation.

As Jellby said, you want to avoid tables if humanly possible. They were never meant for text formatting, and do an abysmal job of it. However, I haven't had enough caffeine yet today to try to explain any of the more appropriate alternatives, so I'll just give you a quick-and-dirty fix for what you have.

Add the following code to your stylesheet:

Code:
.person	{ vertical-align: text-top; }
And change your table code as follows:

Code:
<td class="person">person 1:</td>
That will fix the alignment problems. As far as the rest, learning some more HTML and CSS would probably help you there. My favorite reference website is www.w3schools.com. I believe O'Reilly is currently having a two-for-the-price-of-one sale on ebooks, and they have many fine reference and tutorial books which might be of assistance.
Worldwalker is offline   Reply With Quote
Old 07-28-2010, 07:18 AM   #4
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
Thanks guys for you help.

I'll try the vertical align option for now while I have a play with the indents.
ghostyjack is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone know how to convert a pdf table into a table in Word or HTML? BasilC Workshop 7 06-25-2010 01:02 AM
Chinese text in table of contents/book list does not show up correctly doremifaso PocketBook 0 06-20-2010 10:54 PM
text file and table of content skao Calibre 1 04-09-2010 12:15 PM
Sideway Table in ePub (Rotate table/text) Lapiz ePub 3 01-29-2010 01:11 PM
Forget coffee table books-- how about a kitchen table book? ardeegee Lounge 10 12-02-2009 12:00 PM


All times are GMT -4. The time now is 12:21 AM.


MobileRead.com is a privately owned, operated and funded community.