3
I searched a lot and could not figure out how to customize the header of the report in pdf that Gero from the plugin; for example, the "sTitle": "Groups" is the title that is in the header, but it comes out with the default styling of the plugin, and also don’t know how to add a subtitle with your own style, center, add a date, etc.
Follow the call from the table:
$("#dinamicTable").dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "webroot/libs/datatables/js/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "pdf",
"sTitle": "Grupos"
},
{
"sExtends": "xls",
"sTitle": "Grupos"
}
]
}
});
And the Table:
<table id="dinamicTable" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th width="10%">ID</th>
<th>GRUPO</th>
<th width="10%">STATUS</th>
<th width="10%">OPÇÕES</th>
</tr>
</thead>
<tbody>
<?php foreach ($view_grupos as $grupo) : ?>
<tr>
<td><?php echo $grupo['grup_id']; ?></td>
<td><?php echo $grupo['grup_nome']; ?></td>
<td align="center"><?php echo $grupo['grup_status']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th>ID</th>
<th>GRUPO</th>
<th>STATUS</th>
<th>OPÇÕES</th>
</tr>
</tfoot>
</table>
Just for the sake of conscience, you’ve tried:
<th align="center" width="10%">ID</th>
if that’s what I understand?!– Marcelo Diniz
No, it’s not thead no. It’s the same report header. For example, the
"sTitle": "Grupos"
is the title, however it comes out with the default styling of the plugin, and also do not know how to add a subtitle with your own style, etc...– LeoFelipe
@Leofelipe, I have a question similar to yours. Please see this link, can you help me? http://answall.com/questions/52567/exibir-elemento-search-do-jquery-datatables-em-uma-div-espec%C3%ADfica
– Emerson