KoolReport's Forum

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

PhantomJs Export column width #3474

Open iWorQ Systems opened this topic on 2 days ago - 2 comments

iWorQ Systems commented 2 days ago

we are exporting our our tables and data tables to a pdf and the column widths arent staying what they should be from the table.

What do I need to add to a pdf.view.php data table and table to be able to get the columns not to just auto size?

Sebastian Morales commented 23 hours ago

Have you tried the following column settings for Table and DataTables:

Table::create(array(
    ...
    "columns"=>array(
        "amount"=>array(
            ...
            "cssStyle"=>"width:200px"
        ),


DataTables::create(array(
    ...
    "columns"=>array(
        "orderNumber"=>array(
            ...
            "width"=>"200px",
        ), 
iWorQ Systems commented 16 hours ago

The issue is that we can customly set each columns width and were doing that through the data tables options

'columnDefs' => [
                        [
        "width" => "101.6mm",
        "targets" => 0,
    ],
    [
        "width" => "25.4mm",
        "targets" => 1,
    ],
    [
        "width" => "25.4mm",
        "targets" => 2,
    ]
                    ]

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

DataGrid