php – JQuery DataTables – Customize Header


I did a lot of research and couldn't figure out how to customize the pdf report header that I generate from the plugin; For example, the "sTitle": "Groups" is the title that is in the header, but it leaves with the plugin's default styling, and I also don't know how to add a subtitle with its own style, center, add a date, etc.

Here's the table call:

    "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">
            <th width="10%">ID</th>
            <th width="10%">STATUS</th>
            <th width="10%">OPÇÕES</th>
        <?php foreach ($view_grupos as $grupo) : ?>
                <td><?php echo $grupo['grup_id']; ?></td>
                <td><?php echo $grupo['grup_nome']; ?></td>
                <td align="center"><?php echo $grupo['grup_status']; ?></td>

        <?php endforeach; ?>


Man, I've hit my head a lot with this problem. I read a question on the forum and, according to the creator of the feature Allan Jardine, there is no way to style the "sTitle". It does not accept slashes, hyphens or certain special characters. The author said he is developing new solutions and looking for a better API.

Scroll to Top