Please test this fiddle in Chrome and Firefox. They work differently. In Firefox background is at right position (top enough from the text). But in Chrome background lies below the expected level.
I found an answer here. Bu it does not work for me. I cannot set my table rows to display: block
And I cannot set top padding to td
s. Because there has an element with absolute position inside td
s which takes full height of td
.
The ultimate goal is set background position to top and maintain a distance between each vertical td
.
Thanks for helping.
table {
border-collapse: separate;
width: 100%;
}
tr {
background: url(http://dummyimage.com/10x5/000/fff.jpg) repeat-x left top;
}
td {
border-top: 30px solid transparent;
}
<table>
<tbody>
<tr>
<td>tr1 td1</td>
<td>tr1 td2</td>
<td>tr1 td3</td>
</tr>
<tr>
<td>tr2 td1</td>
<td>tr2 td2</td>
<td>tr2 td3</td>
</tr>
</tbody>
</table>