Problem with big table

Problem with big table

DimaSiKDimaSiK Posts: 6Questions: 0Answers: 0
edited September 2010 in General
I use latest version of datatable. My datatable have mo then 20 columns and thats why all data not fit on the page - http://www.divshare.com/download/12449524-b52 I try to use next parameters to fix this situation:bScrollCollapse, sScrollX, sScrollXInner - better but not so good as I want -http://www.divshare.com/download/12449530-07c Does datatable have good mechanism to fix this situation? Ah, I try to set width for each column, befor I set bAutoWidth to false, but this is not help, why?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    It's really best to have bAutoWidth: true (default) when using scripting as there are a lot of calculations to be done. It's can be set to false, but odd things can happen...

    The table is shrinking to size. So the way to fix it is either:

    1. Add td{ white-space: nowrap } to your CSS, and remove sScrollXInner
    2. Or, make sScrollXInner large (like 200%).

    Allan
  • DimaSiKDimaSiK Posts: 6Questions: 0Answers: 0
    1. Add td{ white-space: nowrap } to your CSS, and remove sScrollXInner - better but not so good
    2. no help
  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    OK

    I have completely opposite problem and I think this will be good place to put rather than starting new discussion.

    In my case I have only three columns (S.No, Name and Size). Since there is lot of space these three columns take almost equal space making ti ugly look. How can I set column width for each so that it look good.

    I am concern as Allan post "It's really best to have bAutoWidth: true (default) when using scripting as there are a lot of calculations to be done. It's can be set to false, but odd things can happen..." So what will be the best solution for this?

    Thanks
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    @DimaSiK - is you set auto width to true, does that help at all. Why do you want to disable it?

    @anjibman - You can use sizing (sWidth or from the DOM or CSS) in conjunction with auto width. The reason it's best to have it enabled is that it will optimise the table display of column exactly as the browser would do. The reason odd things happen when set to false is that _Very_ rarely do the table calculation actually add up as expected. Firstly remember that the table box model is different from the regular one, then there are the margins and borders etc to take into account. It's not trivial :-)

    So if you have three columns that there is a lot of space, can you not just make the table smaller. Or apply a width to the columns just as you would if you weren't using DataTables.

    Allan
This discussion has been closed.