Fixed columns problems

Fixed columns problems

sr1sr1 Posts: 4Questions: 0Answers: 0
edited July 2011 in General
I have a table 40 columns wide, which I wanmt to scroll horizental with 2 fixed left columns.


I have working but are having problems with the one of the left column
http://www.sailracer.us/eventsites/test/table.htm

This contains names of varrying lengthes, the text is wrapping in the cell but data in the otehr row cells is not so this means the table does not align and although you see all the data in the scrolling section, the fixed columns looses teh bottom rows.

Any ideas ?

Simon

Replies

  • GregPGregP Posts: 500Questions: 10Answers: 0
    I know it's not exactly what you're looking for (with any luck, someone with more experience in the fixed columns can help) but you could make a halfway usable fix with a bit of CSS:

    [code]
    .DTFC_LeftBodyWrapper td { overflow: hidden; display: inline }
    [/code]

    What I'm not sure about is where the inline widths for the TDs come from. Certainly a wider second column would also help with the above; by showing more of the name before it becomes cut off, the cut off names would be a rarity.

    But to make all the other cells (the actual data) expand in height automatically is beyond simple HTML; they are technically in different tables and therefore not related to one-another.

    If the code that creates the fixed columns doesn't specify a way to set a height attribute, you could do this with some sort of custom JavaScript. In the fnDrawCallback, you could have a script that finds the computed height of those 'label' cells, and then applies the same height to the data cells.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi Simon,

    This is reposted from the private message you sent me fir the benefit of anyone else reading the thread. Greg's advice is also good for forcing content to be on all one line if you want (you might or might not want that). td { white-space: nowrap; } is very useful for that and does it in one line :-).

    What you want to do is make use of the sHeghtMatch option in FixedColumns and set it to "auto": http://datatables.net/docs/FixedColumns/2.0.0/FixedColumns.defaults.html#sHeightMatch_details .

    The reason that this is required in the case you are using, is tha the semi-automatic height matching which is used by default isn't quiet good enough for your table. The reason that it is the default is that it is good enough for the majority of tables, and it's a lot faster than the auto option. However in some cases, such as what you are seeing the more complete algorithm is required.

    Regards,
    Allan
  • sr1sr1 Posts: 4Questions: 0Answers: 0
    That didn't make any difference, but when combined with css change things move forward :
    http://www.sailracer.us/eventsites/test/table1.htm

    But getting the table repeating at bottom, also some odd resutls when you search, try entereing red
  • sr1sr1 Posts: 4Questions: 0Answers: 0
    Update - now loading data via json and seems to working well, so guess there may be performance issues with large tables in HTML format
This discussion has been closed.