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-09-2018, 11:21 PM   #1
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
table td and margins

I have some text in a table and I want each to outdent.
I do this all the time with,e.g. TOC:
Code:
.toc {
margin-left: 1em;
text-indent:-1em;}
But when I try it with td, the indent is shown, but margins have no effect.

Code:
td, p {font-size:.8em;
vertical-align: top;
text-align: left;
margin-left: 1em;
text-indent:-1em;
} 

<table><tbody><tr>
<td>Edward, Prince of Wales </td>
<td>John de la Pole, Earl of Lincoln </td>
<td>Edward, Earl of Warwick </td>
<td>John of Gloucester </td>
</tr></tbody> </table>
- text in <p> tags does express the margins.
the <td> shows al the formatting except margins.

Even if I do

td { margin: 4em;}

there is zero effect

So, margins just don't work in tables? Yet I see lots of example code here using margins in tr CSS.

================================================
Postscript:


OK, so I tried putting pars inside each td.:


Code:
td {font-size:.8em;
vertical-align: top;
text-align: left;
} 

.out {margin-left: 1em;
text-indent:-1em;
}


<td><p class="out">
          Edward, Prince of Wales
        </p></td>
Now each cell does wrap as intended.

Is there an authoritative reference to what CSS works in tables in epubs, and what does not?
Coding by trial and error is exhausting.

Last edited by AlanHK; 07-10-2018 at 11:17 AM.
AlanHK is offline   Reply With Quote
Old 07-10-2018, 05:42 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Personally I dislike having <p>s inside of <td>s....it just grates my nerves...lol

Have you tried using the padding css instead of margin?

td {padding-left:2em; text-indent:-1.5em}

<tr><td>This would be a hanging indent, or an outdent</td></tr>
Turtle91 is offline   Reply With Quote
Advert
Old 07-10-2018, 10:14 PM   #3
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
I second Dion’s suggestion for padding. I have used this method frequently, and it works -In Sony TS2, ADE for PC, and Calibre reader (which is QTweb based, if I understand correctly).
GrannyGrump is offline   Reply With Quote
Old 07-19-2018, 05:56 PM   #4
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by GrannyGrump View Post
I second Dion’s suggestion for padding. I have used this method frequently, and it works -In Sony TS2, ADE for PC, and Calibre reader (which is QTweb based, if I understand correctly).
+1, we use padding as well.

Hitch
Hitch is offline   Reply With Quote
Old 07-20-2018, 04:12 PM   #5
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by AlanHK View Post
Even if I do

td { margin: 4em;}

there is zero effect

So, margins just don't work in tables?
Of course, you can't change the left/right (or top/bottom) margin of a cell because otherwise you would be displacing THE CELL to left or right (and you are in table). What you can do is to set the margin to the contain of the cell; for that reason works what you enclosed between <p> tags. In this last case, you are displacing the "box" inside the cell and not the cell.
RbnJrg is offline   Reply With Quote
Advert
Old 07-27-2018, 11:38 AM   #6
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by RbnJrg View Post
Of course, you can't change the left/right (or top/bottom) margin of a cell because otherwise you would be displacing THE CELL to left or right.
Thanks. Nice to have a rational reason and not just "it works/doesn't work".

So margins are meaningless; padding it is.

Last edited by AlanHK; 07-27-2018 at 11:46 AM.
AlanHK is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of Contents not being identified as Table of Contents openletter Conversion 2 10-19-2012 12:54 AM
Anyone know how to convert a pdf table into a table in Word or HTML? BasilC Workshop 7 06-25-2010 01:02 AM
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:12 PM.


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