views:

23

answers:

2

i want to show my input data from DB...i'm interest for using jquery dataTable... i have 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..

A: 

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.

Lukasz Dziedzia
yupz..i have a css script..
klox
A: 

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>
klox