bAutoWidth

bAutoWidth

annetannet Posts: 12Questions: 1Answers: 0
edited June 2009 in General
I enabled the following features:

$('#site').dataTable({
'bPaginate': true,
'sPaginationType': 'full_numbers',
'bLengthChange': false,
'bFilter': false,
'bSort': false,
'bInfo': true,
'bAutoWidth': true
});

They all work except the bAutoWidth feature. Is there something else I have to set, or do I have to adjust a style sheet setting to get the bAutoWidth to work?


Kind regards,

Annet

Replies

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin
    Hi Annet,

    What particular aspect of it does not work? It seems to do the trick quite well for me with these features. Also, it's worth noting that you don't actually seen to set bAutoWidth to true since this is the default value (likewise with bInfo and iPaginate).

    Regards,
    Allan
  • annetannet Posts: 12Questions: 1Answers: 0
    Hi Allen,

    Thanks for your instant reply. You are right, dataTables does the trick quite well, I expected the table to scale with the td and the paddings I set. When I removed the width: 100%; property from the table.display selector the table dislayed as I expected.

    However, doing so raised another problem: dataTables_wrapper adjusts its size to the width of the primary column 660px; since the table now various in width, the dataTables_info and datatables_paginate divs most of the times display outside the table's borders, which doesn't look nice. Is there a way to fix this?







    Showing 1 to 2 of 2 entries







    Kind regards,

    Annet.
  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin
    Hi Annet,

    Does adding:

    #dt_core { width: 434px; }

    to your CSS do the trick for you? From your description and code it looks like elements that DataTables adds have a little room to "move about" which is probably the effect you are seeing. So restricting the width that all of DataTables' added elements can have should help.

    Firebug (etc) should be ale to give you more information about what is going on here.

    Regards,
    Allan
This discussion has been closed.