각 th 내부에 일부를 추가하려고합니다. 표 헤더 생성 된 동적 여기에 내가 가지고있는 데이터베이스 열추가 일부 JQuery를 사용하여 각 테이블 헤더 (th)에 일부 텍스트 추가
에 의존한다 :
<table id="dynamic_id" class="table table-striped table-bordered">
<thead>
<tr>
<th>Company Name</th>
<th>Email</th>
<th>Mobile</th>
<th>Address</th>
</tr>
</thead>
<tbody>
//body goes here
</tbody>
</tbody>
</table>
는 준비 이벤트에 jQuery를 사용하여을 기대하는 것입니다.
<th>Company Name
<span class="js-sorter-desc fa fa-chevron-down pull-right"></span>
<span class="js-sorter-asc fa fa-chevron-up pull-right"></span>
</th>
이 각 목에 적용해야한다 ..
<span class="js-sorter-desc fa fa-chevron-down pull-right"></span>
<span class="js-sorter-asc fa fa-chevron-up pull-right">
http://api.jquery.com/append 스택 오버플로 –
에 오신 것을 환영합니다! [둘러보기]를 가지고 둘러보고 [도움], 특히 [* 좋은 질문을하는 법 *] (/ help/how-to-ask)을 읽으십시오. [jQuery API] (http://api.jquery.com)를 통해 작업을 수행하십시오. ** ** 특정 문제가 생기면 현장에서보다 철저한 조사와 검색 (/ 도움/검색)을 한 후 해결할 수없는 경우 문제를 함께 게시하십시오 그것으로. 사람들이 기꺼이 도와 드리겠습니다. –
테이블이 동적 인 경우 사용하는 열 수를 계산하고 각 테이블을 사용하여 내부에 원하는 것을 추가하십시오 –