Responsive extension adds a fixed width

Responsive extension adds a fixed width

berthelemyberthelemy Posts: 2Questions: 1Answers: 0

I've a simple, 3 column table within a page using the HTML Kickstart CSS framework.

When I enable the Responsive extension, a new, inline style element is added to the table, with a width setting equal to the current width of the table. When the window is resized the Responsive behaviour kicks in, but the table remains the same, fixed width.

For example:

With Responsive: false

<table id="presentations" class="display dataTable no-footer" role="grid" aria-describedby="presentations_info">

With Responsive: true

<table id="presentations" class="display dataTable no-footer dtr-inline" role="grid" aria-describedby="presentations_info" style="width: 950px;">

The width:950px remains regardless of the width of the viewport.

Is there a way to make the width: 100% ?

Thanks,

Mark

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,210Questions: 1Answers: 10,415 Site admin
    Answer ✓

    Hi Mark,

    Add style="width: 100%" or width="100%" as an attribute to your table. You might have width: 100% in your stylesheet already, but it is virtually impossible for DataTables to read a relative value from the stylesheet - hence that requirement.

    Allan

  • berthelemyberthelemy Posts: 2Questions: 1Answers: 0

    Thanks @allan
    Much appreciated.
    Mark

This discussion has been closed.