我現在有寫了以下的jQuery dataTable code:
<script>
var myTable = $('#messageTable').DataTable({
"order": [[ 3, "desc" ]],
"columnDefs": [ { type: 'date', 'targets': [3] } ],
"columns" : [ {
"title" : "id",
"data" : "id",
width:'10%'
}, {
"title" : "留言者姓名",
"data" : "name",
width:'20%'
}, {
"title" : "留言",
"data" : "messageStr",
width:'50%'
},{
"title" : "留言日期",
"data" : "addDate",
width:'20%'
} ]
});
</script>