KoolReport's Forum

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

Align columns-pivot table #1038

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

SOFMAN commented on Aug 12

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

Eugene commented on Aug 12

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

Iit's a PivotTable not a Table

Eugene commented on Aug 12

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

Thanks, if it worked

KoolReport Is Free and Open-Source!

KoolReport is a professional php reporting framework which saves you tons of time to construct dynamic data report & dashboard.

  • Connect to various datasources such as MySQL, SQL Server, MongoDB or even from CSV or Excel file.
  • Contain series of powerful built-in data processes for your data manipulation.
  • Generate stunning charts and graphs to help you communicate data insights to your audiences effectively.
  • Integrate seamlessly with any php frameworks such as Laravel, CodeIgniter, Symfony.
Download Now and register our tutorials to get started!

Download KoolReport
help needed
solved

Pivot