HTML:
<div class="col-md-12" class="row" align="center">
<div class="tab-pane active" id="dati">
<form id="listaDeiDati" name="dati" onsubmit="return false;">
<br>
<table id="boxDatiEstratti" class="table table-condensed table-bordered">
<thead class="table-filler">
<tr>
<th rowspan="3">
<div align="center">Colonna codice</div></th>
<th rowspan="3">
<div align="center">Colonna descrizione</div></th>
<?PHP
for ($i=0; $i<10; $i++) { ?>
<th colspan="4">
<div align="center"><?php echo 'Prima riga'; ?></div></th>
<?PHP } ?>
</tr>
<tr>
<?PHP
for ($l=0; $l<10; $l++) { ?>
<th colspan="2">
<div align="center">Seconda riga</div></th>
<th colspan="2">
<div align="center">Seconda riga</div></th>
<?PHP } ?>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
</tfoot>
</table>
</form>
</div>
</div>
<?PHP ?>
JavaScript:
function miaFunzione(dtaamms)
{
$.ajax({
type: "GET",
url: "layout/sch03.php",
data: "dtaamms="+dtaamms,
dateType: 'html',
beforeSend: function () {
waitingDialog.show('Caricamento dati in corso.....attendere prego!', {dialogSize: 'lg', progressType: 'success'});
},
success: function (data) {
waitingDialog.hide(500);
$('#schermate-container').html(data).show("slide", { direction: "left" }, 1000);
$("#boxDatiEstratti").DataTable({
initComplete: function() {
this.api().columns.adjust().draw()
},
"fixedHeader":true,
"paging": false,
"ordering": false,
"info": false,
"searching": true,
"bAutoWidth": true,
"scrollY": "400px",
"sScrollY": ( 0.6 * $(window).height() ),
"destroy": true,
"scrollCollapse": true,
"sScrollX": "100%",
"scrollX": true,
dom: 'Bfrtip',
"language":{
"url": "/assets/js/datatables/datatables.italian.lang",
"decimal": ",",
"thousands": "."
},
"bProcessing": true,
//"bSort": false,
order: [[1, 'asc']],
"bPaginate": false,
buttons: [{
extend: 'excelHtml5',
autoFilter: true,
footer: false,
className: "buttons-excel buttons-html5",
text: "<img src='./img/excel.png'/>",
title: 'Stampa',
init: function(api, node, config) {
$(node).removeClass('btn-default');
$(node).removeClass('btn');
},
exportOptions: {
format: {
body: function(data, row, column, node) {
data = $('<p>' + data + '</p>').text();
var y = data.replace('.', '');
return y.replace(',', '.');
}
//footer: function(data, row, column, node) {
// var x = data.replace('.', '');
// return x.replace(',', '.');
//}
}
}
}]
});
}
});
}