Wrong table caption position

Wrong table caption position

johnny2002johnny2002 Posts: 8Questions: 0Answers: 0
edited May 2010 in Bug reports
When use y-scrolling, the position of the caption of table is wrong. See screenshot.

Replies

  • johnny2002johnny2002 Posts: 8Questions: 0Answers: 0
    edited May 2010
    since there is no where to add attachment, I give an example code here.
    [code]

    Employees


    GPN
    Last name
    First name
    Organization Unit





    00293796

    Meier





    43225759


    Zhou





    00117046

    Blaschette





    43311727

    Perion





    00119007


    Weideli





    00300130

    Zuber





    43232756

    Liu





    00110809


    Spinner





    -0000001

    Internal user





    00836079

    Klemenz





    00131633


    Vaclena





    00358935

    Nyffeler





    00128565

    Grau





    00292355


    Seger





    00735221

    Moor







    $(document).ready(function() {
    $(".dataTables").dataTable( {
    "sScrollY": "200px",
    "bPaginate": false,
    "sDom": 't'
    } );
    });

    [/code]
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Hi johnny2002,

    Good point - I hadn't considered table captions when used with scrolling. I'll fix this in the next beta or final release - which ever happens :-)

    Regards,
    Allan
  • nrogers64nrogers64 Posts: 4Questions: 0Answers: 0
    Hi Allan, it looks like this hasn't been fixed yet. Is this still in your plan?
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    This had clean slipped my mind at the time :-(. I'll try to look at this before the 1.9.1 release next week - but its possibly that it might have to slip to 1.9.2 depending on how complex the fix will be. However, yes, this most certainly should be something that is supported by DataTables and I will make it do so :-)

    Regards,
    Allan
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Just looked at this properly and it would appear I didn't forget about it after all, I just didn't add a comment in this thread :-(. The caption would be correctly positioned in scrolling tables if you left the caption-side CSS option as its default value or set to 'top' (since that is the default), however it wouldn't work if you had:

    [code]
    caption
    {
    caption-side:bottom;
    }
    [/code]

    I've just added the code required to address this issue. It adds a few bytes to the DataTables code base, but I think that captions are fundamental to good accessible tables, which is what DataTables is all about, so its worth it. This will be in 1.9.1.

    Allan
  • nrogers64nrogers64 Posts: 4Questions: 0Answers: 0
    Awesome, thanks!
This discussion has been closed.