사용자:Nessun/common.js: 두 판 사이의 차이

편집 요약 없음
(문서를 비움)
태그: 비우기
1번째 줄: 1번째 줄:
$(window).load(function() {
 
    $('.libre-responsive-table').each(function() {
        var $table = $(this);
        var $cells = $table.find('tbody th, tbody td');
        var $heads = $table.find('thead th');
        var cellsPerRow = $heads.length;
        $heads.each(function(headIndex) {
            var text = $(this).text();
            $cells
                .filter(function(cellIndex) {
                    return cellIndex % cellsPerRow === headIndex;
                })
                .attr('data-th', text);
        });
    });
});

2019년 10월 8일 (화) 17:26 판