// Using aoColumnDefs
$(document).ready(function() {
$('.reporttable').dataTable({
"iDisplayLength": 100,
"bStateSave": true,
"sDom": '<"toolbar">lTfrtip',
"sPaginationType": "full_numbers",
"aoColumnDefs": [
{ "sType": "html", "aTargets": ["fact"] },
{ "sType": "numeric", "aTargets": ["fact"] }
],
"oTableTools": {
"sSwfPath": "{% media_url 'swf/copy_cvs_xls_pdf.swf' %}",
"aButtons": [
{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": [
{"sExtends": "csv", "sFieldBoundary": ''},
"pdf" ]
}
]
}
});
} );
<table class="reporttable">
<thead><tr><th class="fact">12W12</th></tr></thead>
<tbody>
<tr>
<td class="fact"><a href="">9</a></td>
</tr>
<tr>
<td class="fact"><a href="">83</a></td>
</tr>
<tr>
<td class="fact"><a href="">58</a></td>
</tr>
<tr>
<td class="fact"><a href="">1</a></td>
</tr>
<tr>
<td class="fact"><a href="">11</a></td>
</tr>
</tbody>
</table>
<table class="reporttable">
<thead><tr><th class="fact">12W12</th></tr></thead>
<tbody>
<tr>
<td class="fact">2.23</td>
</tr>
<tr>
<td class="fact">4.34355</td>
</tr>
<tr>
<td class="fact">656.78</td>
</tr>
<tr>
<td class="fact">66.78</td>
</tr>
<tr>
<td class="fact">23.3</td>
</tr>
</table>
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.