Set table to 100% width and scrolling

Set table to 100% width and scrolling

hermes980hermes980 Posts: 41Questions: 13Answers: 0

Hi all,

I can't set my datatable to 100% width of the page with scrolling. Any ideas of how I can get my table to be 100% of the viewable page but also allow scrolling. I am using fixedcolumns as well.

Thanks,

K.

Answers

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin

    Can you please link to a test case showing the issue, as per the forum rules.

    I've just put this one together showing it working more or less as I would expect: http://live.datatables.net/pewecati/1/edit .

    Allan

  • hermes980hermes980 Posts: 41Questions: 13Answers: 0

    Thanks Allan,

    I wish I could demo it, but its within a SharePoint Intranet. I am calling my HTML from an XML Viewer Web Part so I suspect its the Web Part having issues. I will continue to test. Many thanks.

    Kelly

  • hermes980hermes980 Posts: 41Questions: 13Answers: 0

    Upon further testing, your code works as expected in a html page, but doesn't cooperate when inserted into a Script Editor or XML Viewer Web Part. Argh. SharePoint!

  • hermes980hermes980 Posts: 41Questions: 13Answers: 0

    If I set a fixed width, it works within SharePoint, but I want the datatable to fill 100% of the page. If I set it to 100%, it flows to the right, has no scroll bar within the datatable, and the browsers horizontal scrollbar kicks in.

This discussion has been closed.