View Single Post
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: 681
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