データテーブルを使用してデータベーステーブルの値を表示しています。私はこれをajaxメソッドを使ってやっています。ここでは、コードJquery Datatables Ajaxメソッドのセル配置
$('#example1').dataTable({
"bProcessing": true,
"sAjaxSource": "filename.php",
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
filename.phpの出力は
{ "aaData": [["1","<input type='checkbox' name='user'> Test Name","Leader","35"]] }
あるHTMLコードは、上記のHTMLで
<table cellpadding="0" cellspacing="0" border="0" class="display tablehead" id="example1">
<thead>
<tr class="colhead newbg">
<th width="17" align="center">No</th>
<th width="194" align="left">User</th>
<th width="56" align="left">Role</th>
<th width="31" align="right">AGE</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
であるあなたが最初の列を見ることができるが、中心位置合わせされています次の2つの列は左揃えになり、最後の列は右揃えになります。しかし、データを出してみると、すべてが中央に位置しています。私は
{ "aaData": [["<div align='center'>1</div>","<div align='left'><input type='checkbox' name='user'> Test Name</div>","<div align='center'>Leader</div>","<div align='right'>35</div>"]] }
は、今私が正しい表示を得たが、年齢によってソートしながら、それは正しくない、次を使用しようとしました。助けてください。ありがとう
ありがとうございました –
@ Vasanthan.RPまた、aoColumnsのドキュメントを見つけることができるリンクを掲載しました –
素晴らしいです。ありがとう –