Responsive column widths

Responsive column widths

jtoler5jtoler5 Posts: 86Questions: 31Answers: 3

Is there not a way to make Responsive listen to the column widths set in the datatables columns array? I have every column set with a specific width and autowidth turned off, with Responsive enabled; it does not listen to these values.

This question has an accepted answers - jump to answer

Answers

  • jtoler5jtoler5 Posts: 86Questions: 31Answers: 3
    edited September 2015

    See [retracted]

    Description column stretches to the longest 'text width' despite width being set to 10%.

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    The problem is that the description column's content wouldn't fit into 10% of the table's width. If you inspect the header element for that column you will see that the width for the column is set to 10%, but the browser is effectively overruling you since that doesn't work.

    There are basically two options:

    1. Truncate the data using overflow: hidden and a wrapper element (its a bit messy)
    2. Allow the text to wrap - you have the nowrap class at the moment thus it is forcing the width.

    Allan

  • jtoler5jtoler5 Posts: 86Questions: 31Answers: 3

    Ok I feel dumb. I do not know how that nowrap got in there. Guess it was just timing that it started when I enabled responsive. Thanks though!

  • jtoler5jtoler5 Posts: 86Questions: 31Answers: 3

    I know what it was now! One of your examples for bootstrap has "nowrap" applied to the table. For some reason I thought it meant it would not wrap a container around the table. Dumb me!

This discussion has been closed.