KoolReport's Forum

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

Table Footer Colspan ? #3069

Open Long opened this topic on on Jun 6, 2023 - 1 comments

Long commented on Jun 6, 2023

As in documentation, i can see header colspan, what about footer ? How can i do footer colspan ? Please provide some example.

Sebastian Morales commented on Jun 6, 2023

It's possible with DataTables widget. You can set a particular column's colspan attribute while hiding other columns' footer like this:

    DataTables::create(array(
        ...
        "columns" => [
            "dollar_sales" => [
                "prefix" => "$",
                "footer" => "sum"
            ],
            "customerName" => [],
        ],
        "attributes" => [
            "tf" => function($colKey, $colMeta) {
                if ($colKey === 'dollar_sales') return [
                    "colspan" => 2,
                ];
            },
        ],
        'cssStyle'=>array(
            'tf' => function($colKey, $colMeta) {
                if ($colKey === 'customerName') return 'display: none';
            }
        )
    )); 

https://www.koolreport.com/docs/datagrid/datatables/#custom-attributes

https://www.koolreport.com/docs/datagrid/datatables/#set-custom-css-styles

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

None