![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> 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." Code:
"Blah, blah, blah, Person: blah, blah, blah, blah." So what I'm looking for is a solution that is screen/resolution independant. Any help would be most appreciated. |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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). |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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; } Code:
<td class="person">person 1:</td> |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |