I\'m using a responsive table style that will collapse for smaller screen sizes and display the table header before each cell.
HTML:
<
-
This small code jQuery copy attr "data-label" TH to TD
$('table th').each(function(i,elem) {
var num = i + 1;
$('table td:nth-child(' + num + ')').attr('data-label', $(elem).text());
});
- 热议问题