내 html 페이지에 테이블을 동적으로 생성하는 데 도움이되는 ajax가 포함되어 있습니다.자바 스크립트를 사용하여 동적 HTML 테이블의 페이지 매김 및 정렬을 소개하는 방법은 무엇입니까?
<title>Clients</title>
</head>
<body>
<table style="width:100%" id="clients_data">
<caption>Clients</caption>
<tr>
<th>Clients</th>
<th>Number of Sites</th>
<th>Reset the Processing</th>
</tr>
</table>
<script>
var myTable;
$(document).ready(function() {
loadCustomers();
});
function loadCustomers() {
$.ajax({
type: 'GET',
url: 'http://localhost:8080/cache/getCustomers',
dataType: 'json',
success: function(data) {
var rows = [];
$.each(data,function(id,value) {
rows.push('<tr><td><a href="clientSiteInfo.html?client='+id+'">'+id+'</td><td>'+value+'</td><td><button type="button" onclick="reset(\''+id+'\')">Reset</td></tr>');
});
$('#clients_data').append(rows.join(''));
}
});
};
</script>
</body>
</html>
런타임에 나는 테이블에 100s의 행을 채울 수 있습니다. jquery를 사용하여이 테이블을 정렬하여 페이지 매김을 추가하는 방법은 무엇입니까?
감사합니다. 언급 된 가이드에서 datable의 버그에 직면하고 있습니다. 나는 여기에 새로운 질문을 게시했습니다. 확인해 주실 수 있습니까? https : //stackoverflow.com/questions/46780285/datatable-pagination-is-not-working – Ratha