Columns are pulled left and grow on ordering

Columns are pulled left and grow on ordering

I2SUserI2SUser Posts: 5Questions: 3Answers: 0

I am using DataTables across multiple pages to show data. I am running into an issue I can't seem to fix. The first is that my columns are all pulling left. The entire DataTables container is the size it should be, however the columns are all shifted to the left and a large amount of blank space exists to the right of the columns. This isn't on all of my instances of DataTables, but only a few. Any ideas on where I could start looking to fix this issue?

The second issue that I am seeing is that when I re-order my columns they grow. I have looked at a few explainations on the forums here but the various fixes have not worked. From setting the 'width: [xxx]px' and making 'scrollX: false' still results in the outside container remaining the correct size but the columns expanding outside the container resulting in a scroll bar on X.

These issues are linked, but not always. I have other DataTables that the columns are distributed normally but grow on ordering. Any ideas on what could be causing this strange behavior?

Answers

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

    Hi,

    Thanks for your questions.

    Regarding the first question about table width - do you have width: 100% set in the CSS for the tables, or better yet the HTML width="100%" attribute set for the table? The attribute is useful because DataTables can read that directly as a percentage value, but it can't (without a huge amount of complexity) read the CSS value as a percentage.

    Failing that, are you able to link me to the page so I can take a look and see what is going on?

    For the column reordering question - can you confirm that you are using the latest versions of both DataTables (1.10.2) and ColReorder (1.1.2) please? Again, failing that, I would need a link to the page showing the issue so I can debug and resolve it.

    Regards,
    Allan

This discussion has been closed.