KoolReport's Forum

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

Using cssStyle ? #1528

Open Richb201 opened this topic on on Jul 13, 2020 - 1 comments

Richb201 commented on Jul 13, 2020

Here is another question for you. The "documentation" say to use this to modify the style in a table

"customerName"=>array(
                "cssStyle"=>array(
                    "th"=>"font-weight:bold;text-align:center",
                    "tr"=>"text-align:center",
                    "tf"=>"text-align:center",
                )
            )

But in another email I was told to copy the style from the text I want to match to. Here it is:

.table td {
    padding: 8px;
    line-height: 18px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid #dddddd;

How do i take the copied style and make it work in cssStyle?

David Winterburn commented on Jul 14, 2020

Here's the way:

"columns"=>array(
            "column1"=>array(
                "cssStyle"=>"padding: 8px; line-height: 18px; text-align: left; vertical-align: top; border-top: 1px solid #dddddd;"
            ),

However, I would suggest add the following style directly to your report page:

<style>
#myTable td {
    padding: 8px;
    line-height: 18px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid #dddddd;
}
<?php
    Table::create(array(
        "name" => "myTable",
        ...
    ));
?>
</style>

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
None yet

None