2017-01-19 2 views
0

부트 스트랩 테이블을 사용하고 있으며 첫 번째 열의 기본 정렬이 있습니다. 기본 열을 변경하고 다른 열을 선택하고 (오름차순/내림차순)을 사용하는 방법부트 스트랩 테이블 기본 정렬

+0

안녕하세요. [mcve] (http : // s tackoverflow.com/help/mcve) – bhansa

답변

-1

물어보기 전에 먼저 검색해야합니다. 이것에 관한 많은 주제. 가장 좋은 답변자는 Bootstrap - How to sort table columns입니다. U는 코드 스 니펫을 실행하여 한 가지 예를 볼 수 있습니다.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/><link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.0/bootstrap-table.min.css" rel="stylesheet"/><table data-toggle="table" data-url="https://api.github.com/users/wenzhixin/repos?type=owner&sort=full_name&direction=asc&per_page=100&page=1" data-sort-name="stargazers_count" data-sort-order="desc"> <thead> <tr> <th data-field="name" data-sortable="true"> Name </th> <th data-field="stargazers_count" data-sortable="true"> Stars </th> <th data-field="forks_count" data-sortable="true"> Forks </th> <th data-field="description" data-sortable="true"> Description </th> </tr></thead></table><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.0/bootstrap-table.min.js"></script>