View Full Version : Help with vertical alignment, table cell content


meadowlarkOR
12-28-2011, 02:16 PM
Hello all,

I am converting book chapters from InDesign CS 5.5 to epub. I have some tables that are giving me trouble, and I'm pretty new to CSS so in trying to correct the problems I have double trouble.

My table converts OK except that the text within the table cells is vertically aligned to the middle. I want it to align to the top. I added some CSS code I thought would do that, below. The part I added is "vertical-align : top;". It made no difference. Any ideas for me?

Thank you.

p.table-text {
font-family : "Palatino Linotype", serif;
font-weight : normal;
font-style : normal;
font-size : 0.79em;
text-decoration : none;
font-variant : normal;
line-height : 1.16;
text-align : left;
vertical-align : top;
color : #000000;
text-indent : 0px;
margin : 0px;
}

AndiPersti
01-01-2012, 08:46 AM
My table converts OK except that the text within the table cells is vertically aligned to the middle. I want it to align to the top. I added some CSS code I thought would do that, below. The part I added is "vertical-align : top;". It made no difference. Any ideas for me?


In your css-rule you're setting "vertical-align" on the <p>-tag. But this just aligns every single paragraph within its box.
You should put it on the <td>-tag instead which styles the whole table cell:


td {vertical-align: top;}


HTH, Andreas