KoolReport's Forum

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

Align columns-pivot table #1038

Closed SOFMAN opened this topic on on Aug 12, 2019 - 4 comments

SOFMAN commented on Aug 12, 2019

How to align columns to the right in a pivot table?

Eugene commented on Aug 12, 2019

Hi, for me the following works

For example if i need to set style for the name column I do

Table::create(array(
...

 "cssClass" => array(
           
            "td" => function ($row, $columnName) {
                return ($columnName == "name") ? "cell-class-name" : "cell-class";
            },
...
)))

where css style

.cell-class-name {
    text-align: right;
}
SOFMAN commented on Aug 12, 2019

Iit's a PivotTable not a Table

Eugene commented on Aug 12, 2019

PivotTable (version >= 6.0.0) has also the "cssClass" property so the logic is the same

you can do something like this

'cssClass' => array(
                'rowHeader' => function($value, $cellInfo) {

                    return "cell-class-name";
                    }
            ),

to get the following

More info here

SOFMAN commented on Aug 13, 2019

Thanks, if it worked

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
help needed
solved

Pivot