KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Align columns-pivot table #1038

Closed SOFMAN opened this topic on 6 days ago - 4 comments

SOFMAN commented 6 days ago

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

Eugene commented 6 days ago

Hi, for me the following works

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


 "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 6 days ago

Iit's a PivotTable not a Table

Eugene commented 6 days ago

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 5 days ago

Thanks, if it worked

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed