There seems a lot online about this but it's incredibly confusing so I'd like to try to get a definitive answer.
I have a table, say 2 columns and 2 rows.
1 | 2
3 | 4
I want it to collapse into rows when viewport requires it.
1
2
3
4
My code is as follows
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="resptable">
<tr>
<td>Text 1</td>
<td>Text 2</td>
</tr>
<tr>
<td>Text 3</td>
<td>Text 4</td>
</tr>
</table>
And the css for the stacked version is as follows.
.resptable td {display:block;width:100% !important;padding-right:20px;}
This seems ok in FF and Chrome but not in Safari or IE.
Bizarrely (to me), identical code attached to a TH not a TD works in Safari (though still not in IE).
In a world where every site must be responsive, it beggars belief that there are still 1000s of cross-browser/device issues.
Anyone got the definite cross-browser method for this simple task?