• Resolved ianhooper1984

    (@ianhooper1984)


    Hi,

    I am having trouble setting column width so that the titles in the header are on one line instead of two or three.

    I have unchecked ‘Use DataTables’, set the responsive mode to ‘scroll’ and used the below code to set the column widths.

    .tablepress-id-1 .column-2,
    .tablepress-id-1 .column-3,
    .tablepress-id-1 .column-4,
    .tablepress-id-1 .column-5,
    .tablepress-id-1 .column-6,
    .tablepress-id-1 .column-7,
    .tablepress-id-1 .column-8,
    .tablepress-id-1 .column-9,
    .tablepress-id-1 .column-10,
    .tablepress-id-1 .column-11,
    .tablepress-id-1 .column-12,
    .tablepress-id-1 .column-13,
    .tablepress-id-1 .column-14,
    .tablepress-id-1 .column-15,
    .tablepress-id-1 .column-16,
    .tablepress-id-1 .column-17 {
    width: 150px !important;
    }

    However, this does not have an effect and the table still seem constrained to the container instead of scrolling.

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Instead of fiddling with column widths (which often does not work, due to how browser apply widths), I suggest that we then simply disallow automatic line breaks in the table header row. For that, please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-1 thead th {
      white-space: nowrap;
    }

    Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘Fixed Column Width’ is closed to new replies.