KoolReport's Forum

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

Disable table column labels #2311

Open Yassin opened this topic on on Aug 31, 2021 - 3 comments

Yassin commented on Aug 31, 2021

Hi,

I have a table with a custom header.

Is it possible to disable the column labels so it does not repeat?

Sebastian Morales commented on Sep 1, 2021

If you meant the core Table widget there's a property called "showHeader" that you could set to false:

\koolreport\widgets\koolphp::create(array(
    ...
    "showHeader" => false,
));
Yassin commented on Sep 1, 2021

Yes it is the core Table widget.

I do want to show the header, but not the column labels.

If i set "showHeader" => false both header and column labels do not appear (labels are added to last tr).

Here is a sample code:

Table::create([
    "headers" => [
        [
            "Provincia" => ["rowspan" => "3"],
            "Número de US Avaliadas" => ["rowspan" => "3"],
            "Tipo de Avalição" => ["colspan" => "4"],
            "Total" => ["rowspan" => "3"],
            "Avaliações Esperadas" => ["rowspan" => "2", "colspan" => "2"],
            "Avaliações Realizadas a tempo" => ["rowspan" => "2", "colspan" => "2"],
        ],
        [
            "Linha de Base" => ["rowspan" => "2"],
            "Interna" => ["rowspan" => "2"],
            "Externa" => ["colspan" => "2"],
        ],
        [
            "Nível Central" => [],
            "Provincial" => [],
            "Nº" => [],
            "%" => [],
            "Nº " => [],
            "% " => [],
        ],
    ],
    "columns" => [
        "provincia" => [
            "label" => "Provincia",
        ],
        "nmero_de_us_avaliadas" => [
            "label" => "Número de US Avaliadas",
        ],
        "linha_de_base" => [
            "label" => "Linha de Base",
        ],
        //...
    ],
]);

For now I think I can get by using:

.kool-report thead tr:last-child {
    display: none;
}

But maybe there is another way.

Sebastian Morales commented on Sep 2, 2021

I think both showing/hiding the custom set headers and the default ones are under the same property. We will see if we could add more options to separately show/hide them. Meanwhile, using a CSS rule solution like yours is not a bad idea:

<style>
#myTable thead tr:last-child {
    display: none;
}
</style>
<?php
Table::create(array(
    "name" => "myTable",
    ...

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