Testing Cell Width
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<div class="table-responsive bis">
<table class=" table table-striped" id="header">
</table>
<table class=" table table-striped" id="datatable_pagament_invisibile">
<thead class="">
<tr id="">
<th class=" ">Categoria</th>
<th class=" ">Descrizione</th>
<th class=" ">Codice</th>
<th class=" ">Stampa dati bancari</th>
<th class=" ">Stampa dati cliente</th>
<th class=" ">I.V.A. prima rata</th>
<th class=" ">D.F.F.M</th>
<th class=" "> Numero di rate</th>
<th class=" "> Giorni aggiuntivi</th>
<th class=" "> 1° rata</th>
<th class=" "> 2° rata</th>
<th class=" "> 3° rata</th>
<th class=""> Visibile</th>
<th class=""> Periodo</th>
</tr>
</thead>
<tbody>
<tr><td value="1-1">3</td><td value="1-2">R.D. 90 giorni D.F.F.M.</td><td value="1-3">00001</td><td value="1-4">1</td><td value="1-5">0</td><td value="1-6">0</td><td value="1-7">1</td><td value="1-8">1</td><td value="1-9">0</td><td value="1-10">90</td><td value="1-11">0</td><td value="1-12">0</td><td value="1-13">1</td><td value="1-14">0</td></tr><tr><td value="2-1">2</td><td value="2-2">Ri.Ba. 30/60/90 giorni D.F.F.M.</td><td value="2-3">00002</td><td value="2-4">0</td><td value="2-5">1</td><td value="2-6">0</td><td value="2-7">1</td><td value="2-8">3</td><td value="2-9">0</td><td value="2-10">30</td><td value="2-11">60</td><td value="2-12">90</td><td value="2-13">1</td><td value="2-14">0</td></tr><tr><td value="3-1">2</td><td value="3-2">Ri.Ba. 90 giorni + 5</td><td value="3-3">00003</td><td value="3-4">0</td><td value="3-5">1</td><td value="3-6">0</td><td value="3-7">0</td><td value="3-8">1</td><td...
CSS
.table-responsive {
overflow-y:scroll;
height:300px;
display:block;
}
#header {
position: relative;
top: 0;
}
#header th {
display:inline-block;
float: left;
vertical-align:bottom;
}
JavaScript
resizeCol(14);
function resizeCol(numerocolonne){
$('#datatable_pagament_invisibile thead').clone().appendTo('#header');
var $headers = $('#datatable_pagament_invisibile th');
$headers.each(function(index, el) {
$('#header').width($('#datatable_pagament_invisibile').width());
//$('#header thead th').height($('#datatable_pagament_invisibile thead').height());
$('#header th').eq($headers.index(this)).width($(this).width());
});
}