DataTables are responsive only on refresh (sometimes two refreshes required)

DataTables are responsive only on refresh (sometimes two refreshes required)

firepebblefirepebble Posts: 2Questions: 1Answers: 0

First time I go fresh to my instance of DataTables the table takes up the whole screen rather than responding to the smaller screen. When I refresh it behaves nicely. How is this happening and any advice?

Debugger reference is: uvovoj.

Website in beta is: http://www.menublob.com/restaurant-list.php

CSS container for the body is:

body {
width :700px;
margin:7px auto;
background:#f8f8f8;
border:1px solid #343A4C;
border-radius: 6px;
}

DataTables CSS is standard except for:
div.container {
width: 95%;
margin-left:5px;
}

I've tried putting this script up the top, or down the bottom, but no luck.

$(document).ready(function() { $('#restaurant_list').DataTable( { responsive: true, stateSave:true } ); } );

Thanks!

Answers

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    Responsive barely seems to be working on the first load oddly enough. I'm afraid I've got quite a pile of things to do at the moment, so I can't look into this in detail immediately, but I will come back to this when I can, as there is certainly a problem there.

    Thanks,
    Allan

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    One thing - could you try updating to Responsive 1.0.2-dev which is available on the downloads page.

    Thanks,
    Allan

  • firepebblefirepebble Posts: 2Questions: 1Answers: 0
    edited September 2014

    Thanks Allan,

    I linked straight to the nightly build for JS and CSS for both DataTables and Responsive to give it a go. Still the same. Could using php to echo out the script cause issues?

    Andrew.

This discussion has been closed.