开发者

dataTable head not show inside tabs

i want to show my input data from DB...i'm interest for using jquery dataTable... i 开发者_如何学Chave been type some code but it seems not like what i want..i put inside tabs. and table head not show..it's so ugly..

<table cellpadding="0" cellspacing="0" border="0" class="display" id="datalist">
                    <thead>
                            <tr>
                                    <th>Line </th>
                                    <th>Model </th>
                                    <th>Serial Number </th>
                                    <th>NIK </th>
                            <tr>
                    <thead>

                    <tbody>
                    </tbody>
            </table>


    <script>
    var oTable;
    $(document).ready(function(){
    oTable= $('#datalist').dataTable( {
                                     "bServerSide": true,
                                     "bProcessing": true,
                                     "sAjaxSource": 'process1.php',
                                     "aaSorting"  : [[1, "desc"]],
                                     "aoColumns"  : [
                                                     /*Line*/ null,
                                                     /*Model*/ null,
                                                     /*Serial Number*/ null,
                                                     /*NIK*/ null
                                                    ]
                                     } );

                    }); 
     </script>

what must i do?please help..


I use datatables in many of my projects and I have no problems with that. Do you receive any javascirpt or server side errors?

Your code looks almost good. Only bug I can see now is 'aocolumns' - there is no such thing, use aoColumns instead.

Maybe the reason your datatable is not showing properly is a lack of included css file? by default datatables are not styled in any way unless you assign some css (examples can be found on datatables.net)

There is also great community forum on datatables.net where you can find a lot of people experienced with this plugin.


this is the most influential and should be there if your program want to run well:

<link href=".../demo_table.css" rel="stylesheet" type="text/css" media="all">
 <script type="text/javascript" language="javascript" src=".../jquery.dataTables.min.js"></script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜