Reputation: 3496
I'm using tables per a client's request for a design. (Read: No other option)
All the table cells seem to be applying some sort of vertical padding and screwing up all my spacing. I've changed the text/background color of one of the cells on the fiddle to show you what I mean. I have tried setting margin and padding to 0 on all applicable elements.
Thanks for any help!
<table width="346" border="0" cellpadding="0" cellspacing="0">
<tr height="66">
<td width="85" style="padding:0;" align="left" valign="top">
<span style="font-size:66px;font-weight:bold;line-height:50ox;">50</span>
</td>
<td width="50" align="left" valign="middle">
<table border="0" cellpadding="0" cellspacing="0">
<tr height="30">
<td width="50" align="center" valign="bottom">
<span style="font-size:28px;font-weight:bold;">%</span>
</td>
</tr>
<tr height="20">
<td width="50" align="center" valign="bottom">
<span style="font-size:28px;font-weight:bold;">OFF</span>
</td>
</tr>
</table>
</td>
<td width="211"></td>
</tr>
</table>
JSFiddle: http://jsfiddle.net/EMtxu/
(note that I'm only looking at the vertical padding, not the right side which is just a result of the cell size)
Upvotes: 0
Views: 135
Reputation: 158
I think what you're seeing is a combination of two things:
Solution: set a hard line-height on the "50" that is less than or equal to the font-size.
Upvotes: 0
Reputation: 4350
I am assuming the reason you are using inline styles is because you are doing an email. Try removing the tr
heights on those child elements and set the line height for both span
s. Here is the updated fiddle: http://jsfiddle.net/EMtxu/2/
Upvotes: 1