KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Cannot get the table headers text to change color or the Footers #3483

Open iWorQ Systems opened this topic on on Jun 15 - 5 comments

iWorQ Systems commented on Jun 15

I cannot seem to get the header text or any of the footer styles be able to change. I was just wondering if there were certain things I needed to do in the style to fix this?

this is for a phantomJs export

iWorQ Systems commented on Jun 17

We figured out the header has a div in it and as soon as we put css in the div the headers changed. But still nothing for the Footer that is forcing weird css rules.

Sebastian Morales commented on Jun 22

Would you pls let us know which table widget you used, is it core's Table or datagrid's DataTables?

iWorQ Systems commented on Jun 22

we are using both DataTables and Core Table. Both are not working.

Sebastian Morales commented on Jun 30

Sorry for the delay. Regarding table cell/footer css color when printing, it seems the problem is because Bootstrap theme overrides the td, tf colors when printing. Our solution would be adding a css class to the cell/footer and set the css rule for that exact class to override Bootstrap's like this:

<style>
    @media print {
        /* 1. Beat the override on the cell itself */
        tfoot td.my-cell {
            color: blue !important;
        }
    }
</style>
<?php
    Table::create(array(
        ...
        "cssClass" => array(
            "tf" => function ($columnName) { 
                return "my-cell"; // or return class based on column name
            },
        )
    ));

Another solution is using table name like this:

<style>
    @media print {
        #myTable tfoot td {
            color: blue !important;
        }
    }
</style>
<?php
    Table::create(array(
        "name" => "myTable",
        ...
    ));

Let us know how this works for you. Tks,

iWorQ Systems commented on Jul 6

The second solution worked for us! thank you!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

Export