Extra header row on scrollable table - Why?

Extra header row on scrollable table - Why?

jtopjtop Posts: 17Questions: 2Answers: 0
edited July 2011 in DataTables 1.8
I'm working with the FixedColumns extras and it seems that it is creating a ... empty row that mimics my current static header, but without any text. It is only reproducing the cells. When I use Chrome I can remove this node from the DOM and it looks fine. The table aligns perfectly.

Any thoughts?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you link to an example showing the issue please? FixedColumns will clone the thead element, but should be hiding it if needed.

    Allan
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    I had a similar problem when I used visible css elements in my header. When DataTables created it's own header (it puts it into a separate container, not in the table) and tried to hide my existing header, those visible elements kept the thead from being hidden, so I had 2 headers showing.

    What I did to cause this was use :after content to show unicode characters for up and down arrow rather than use the image-based indicators that Allan has in his css.
  • jtopjtop Posts: 17Questions: 2Answers: 0
    Sorry,

    I should have responded, sooner but... I did use css to do a display: none; on the head of that table this seems to work. I guess my question was if there was a reason why the extra .. is created?

    The way I found it was I had a table which the users wanted a color header on the scrollable columns and a different color on the static portion. It also might have something to do with the fact that I have 2 rows in the .

    [code]



    <!-- static column -->
    <!-- static column -->
    <!-- static column -->
    Pass
    Fail




    Name
    Assignment
    A
    B
    C
    D
    F
    I
    N/A
    Excuse


    ......


    [/code]
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    I guess I can't tell you why the extra THEAD (and an extra TFOOT) are used, but DataTables does put the header and footer into separate tables in different divs and just makes the initial THEAD and TFOOT invisible.

    I think DataTables expects your THEAD row to be one row only. (I'm not sure if you were saying you use multiple rows in your THEAD.)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The table model is basically replicated in a 3x3 grid when using FixedColumns - with elements hidden as required. This is done in order to ensure that tables all have the same information in them and thus have the same alignment (important since visually it looks like it is only one table).

    DataTables and FixedColumns should have no problems with multiple TR elements in the header, as shown in this example: http://datatables.net/release-datatables/extras/FixedColumns/rowspan.html . So I'm not entirely sure what is going on here. A link would be very useful, but its good to hear you have a work around.

    Allan
  • jtopjtop Posts: 17Questions: 2Answers: 0
    Allan,

    Is there anyway I can upload a copy of any example or send you a copy. We live behind a proxy, so its kind of hard to post any example of the issue i'm running into. I also found that by adding the css display:none in IE actually causes the table cells to shrink to fit the content.

    Thanks.
This discussion has been closed.