Even these days (3 years later) this question is still actual. I did not use theme_roller
as suggested.
In most cases problems are:
- wrong ordering styles or javascript files,
- missed to load any of required files,
- conflict or overwriting theme with extensions' style,
- extension not initialized (eg.
dom: "Bfltip"
).
To use jQueryUI theme with DataTables (in current version 1.10.8) next order ony worked for me:
CSS
dataTables.jqueryui.css
smoothness/jquery-ui.css
JS
jquery.js
jquery-ui.js
jquery.dataTables.js
dataTables.jqueryui.js
$(document).ready(function() {
var table = $('#dataContainer');
table.DataTable({});
});
@import url("//cdn.datatables.net/1.10.8/css/dataTables.jqueryui.css");
@import url("//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css");
<html>
<head>
<!-- link master.css -->
</head>
<body>
<table id="dataContainer" class="display" cellspacing="0" width="100%">
<thead>
<tr><th>Position</th><th>Age</th><th>Start date</th></tr>
</thead>
<tr><td>batman</td><td>17</td><td>2015-12-26</td></tr>
<tr><td>marko kraljevic</td><td>18</td><td>2015-12-26</td></tr>
<tr><td>superman</td><td>1</td><td>2015-06-29</td></tr>
</table>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.4.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/1.10.8/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/1.10.8/js/dataTables.jqueryui.js"></script>
</body>
</html>
Extensions
Manual (Download Builder) suggested to add extensions (eg. Buttons/Print,Select) styles at the end.
CSS
buttons.jqueryui.css
JS
dataTables.buttons.js
buttons.jqueryui.js
buttons.print.js
Although button works (don't forget to initialize it), but this breaks styling. Missing part to play with is (dataTables ver < v1.11):
js
dom : '<"H"B<"dt-make-valign-center"lfr>>t<"F"ip>',
jQueryUI: true,
css
.dt-make-valign-center {
margin: 5px;
}
Working code with Button:
$(document).ready(function() {
var table = $('#dataContainer');
table.DataTable({
dom: '<"H"B<lfr>>t<"F"ip>',
jQueryUI: true,
buttons: [
'print'
]
});
});
@import url("//cdn.datatables.net/1.10.8/css/dataTables.jqueryui.css");
@import url("//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css");
@import url("//cdn.datatables.net/buttons/1.0.0/css/buttons.jqueryui.css");
<html>
<head>
<!-- link master.css -->
</head>
<body>
<table id="dataContainer" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Position</th>
<th>Age</th>
<th>Start date</th>
</tr>
</thead>
<tr>
<td>batman</td>
<td>17</td>
<td>2015-12-26</td>
</tr>
<tr>
<td>marko kraljevic</td>
<td>18</td>
<td>2015-12-26</td>
</tr>
<tr>
<td>superman</td>
<td>1</td>
<td>2015-06-29</td>
</tr>
</table>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.4.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/1.10.8/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/1.10.8/js/dataTables.jqueryui.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/buttons/1.0.0/js/buttons.jqueryui.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/buttons/1.0.0/js/buttons.print.js"></script>
</body>
</html>