This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 2 years, 5 months ago.

Datatables change width of column.


  • woonipad
    Participant

    Posts: 3
    Member Reply #5906

    Hello,
    I am creating table using datatables example from .
    I need to change the width of the column, and I found out I that I can use “sWidth”: “50px”.

    "columns": [
    { data: "strCheckBox" ,"sWidth": "50px"},
    { data: "custOrderNo","sWidth": "50px"},
    { data: "deliveryToCustName", "sWidth": "250px" },
    ]

    However, the column width does not changed.
    Please tell me how to accomplish this task.
    Thanks in advance.

    Sean
    Sean
    Keymaster

    Posts: 4527
    Support Staff Reply #5910

    Hi,

    Please try to set auto width to false using below option:
    https://datatables.net/reference/option/autoWidth

    Thus you can set fixed width to individual columns as you did above. For more info please check the official plugin documentation further.

    Thanks.

Tagged: 

You must be logged in to reply to this topic.