Put personalised titte in exports files buttons multiple tables
Put personalised titte in exports files buttons multiple tables
danielandres.feo
Posts: 5Questions: 0Answers: 1
<table class="rwd-table" data-name="Modalidades" border="0">
<thead>
<tr>
<th>Aliado</th>
<th>Modalidad</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h5> pizza</h5>
</td>
<td>
<h5> free</h5>
</td>
</tr>
</tbody>
</table>
<table class="rwd-table" data-name="Restricciones" border="0">
<thead>
<tr>
<th>Restriccion</th>
<th>Observacion</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h5>No feed</h5>
</td>
<td>
<h5> permitido</h5>
</td>
</tr>
</tbody>
</table>
$(document).ready(function () {
$('body table').each(function() {
var titulo = $(this).data('name');
$(this).dataTable({
dom: 'Bfrtip',
buttons: [
{
extend: 'excel',
title: titulo
},
{
extend: 'print',
title: titulo
}
]
});
});
});
This discussion has been closed.