Encountering an unusual issue with my table content
.table {
position:absolute;
top:12px;
left:3px;
width:87px;
height:74px;
}
.table tr {
vertical-align:middle;
}
.table td {
text-align:center;
padding:1px;color:#000000;
font-size:1em;
line-height:1.5em;
width: 50px;
}
.table td span {
padding:3px 5px;
font-size:1em;
background-color:yellow;
}
HTML
<table class="table" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><span>example 1</span>
</td>
</tr>
</tbody>
</table>
Trying to set a white background for the text inside span
, without extending it to only the edge of the texts by applying padding
.
Some texts end up inside the background, while others don't.
for example
some texts are like these...
-------
|example|
-------
or
--------
| example|
--------
This is what I want.
---------
| example |
---------
Increased the width of td
, span
and tr
but still facing issues.