user3889963 user3889963 - 1 year ago 97
CSS Question

Datatable styling not working

I have a peculiar problem. I am developing a php site that required Datatables to work with it. I noticed that Datatables styling does not work when I run it on localhost be it Firefox or Chrome. My code is as follows:

<!DOCTYPE html>
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
<meta charset="UTF-8">
<link rel="text/css" href="//"/>
<script src="//" type="text/javascript"></script>
<script src="//" type="text/javascript"></script>
$(document).ready(function() {
} );
<table id="example" class="display" cellspacing="0" width="100%">
<th>Start date</th>
<th>Start date</th>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Garrett Winters</td>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>

And this gives me a rather ugly version of the datatable. Search functionalities and filtering works but is missing styles and column reordering.

However the strange thing is that a jsfiddle that I drew up containing the same data render as expected, with all styling, etc... The fiddle link is as follows:

I'm using XAMPP server with firefox as my default browser. Can someone help me figure this out? I may be doing some very obvious mistake but I'm failing to see it. Thank You.

Answer Source
<link rel="stylesheet" type="text/css" href="//">

Your link tag to CSS is wrong. Maybe some browsers won't process it correctly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download