Backend/ Admin page-Table display with added features

I have seen many people used to code themselves for the backend table. As they don't know that there are many plugins for the table for the Backend or Admin page.
I also used to program myself but It took lot of time.

I have researched to accomplish these things for less and fast time to program.

Datatable.js is the best way to use the table display in the Backend / Admin page. This js has features of sorting, pagination and searching

Tutorial for the data table.

First of all, we need JAVASCRIPT and CSS files.  Download
Place this inside <head> tag.




<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.js"></script> 


Now the javascript code. place this code anywhere inside body.



<script>
        $(function() {
        $('#example').dataTable();
        } );
</script>

Now just paste the code below


<table class="display" id="example">
   <thead>
      <tr>
            <th>Rendering engine</th>
            <th>Browser</th>
            <th>Platform(s)</th>
            <th>Engine version</th>
            <th>CSS grade</th>
        </tr>
    </thead>
    <!--You can also use loop for this data-->
    <tbody>
        <tr class="gradeX">
            <td>Trident</td>
            <td>Internet Explorer 4.0</td>
            <td>Win 95+</td>
            <td class="center">4</td>
            <td class="center">X</td>
        </tr>
        <tr class="gradeA">
            <td>Gecko</td>
            <td>Camino 1.0</td>
            <td>OSX.2+</td>
            <td class="center">1.8</td>
            <td class="center">A</td>
        </tr>
       
        <tr class="gradeA">
            <td>Gecko</td>
            <td>Netscape Navigator 9</td>
            <td>Win 98+ / OSX.2+</td>
            <td class="center">1.8</td>
            <td class="center">A</td>
        </tr>
        <tr class="gradeA">
            <td>Gecko</td>
            <td>Mozilla 1.0</td>
            <td>Win 95+ / OSX.1+</td>
            <td class="center">1</td>
            <td class="center">A</td>
        </tr>
        <tr class="gradeA">
            <td>Gecko</td>
            <td>Mozilla 1.1</td>
            <td>Win 95+ / OSX.1+</td>
            <td class="center">1.1</td>
            <td class="center">A</td>
        </tr>
        <tr class="gradeA">
            <td>Gecko</td>
            <td>Mozilla 1.6</td>
            <td>Win 95+ / OSX.1+</td>
            <td class="center">1.6</td>
            <td class="center">A</td>
        </tr>
    </tbody> 
<!--Till here-->
    <tfoot>
        <tr>
            <th>Rendering engine</th>
            <th>Browser</th>
            <th>Platform(s)</th>
            <th>Engine version</th>
            <th>CSS grade</th>
        </tr>
    </tfoot>
</table>

And this is it. Enjoy the datatable. Which is the simpliest way of use all features in the backend of the website.

Comments

Popular posts from this blog

Google map API using MarkerClusterer and Geocoder

Sharing with Social media (Facebook, Twitter, tumblr, pinterest) while clicking using javascript

Line or Graph chart for data in array.