columns not resizing to fill table width

columns not resizing to fill table width

ZxurianZxurian Posts: 26Questions: 6Answers: 0
edited January 2012 in General
so i've got a table defined as follows:
[code] var results_dt = $("#results").dataTable({
aoColumnDefs: [
{ aTargets: [ 0 ], sWidth: "70px" },
{ aTargets: [ 1 ], sWidth: "200px" },
{ aTargets: [ 2 ], sWidth: "200px" },
{ aTargets: [ 4 ], sClass: "center", sWidth: "65px" },
{ aTargets: [ 5 ], sClass: "center", sWidth: "65px" }
],
bJQueryUI: true,
bProcessing: true,
bAutoWidth: true,
sAjaxSource: "'.WWW_ROOT.'handler.php?action=list_files&"+form_search.serialize()
});[/code]

by my understanding, this should set a fixed width to every column but the 4th one, allowing it to fill up the available space left in the table, however the results that I get look like this: http://gyazo.com/651e931e6c980e11e6b1497a5e695bed

any ideas on how to get the 4th column to properly fill up the remaining space?

I tried downloading v1.8.2 (was using v1.8.1) but still same effect.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Have you got:

    [code]
    table { width: 100% }
    [/code]

    somewhere in your CSS if you want to have a table take up 100% width?

    Allan
  • ZxurianZxurian Posts: 26Questions: 6Answers: 0
    the following is my html
    [code]

    DateCruiseNameCommentMultiple Cruises?Planning Future Cruise


    [/code]

    and the css that relates to it
    [code] #results {
    width: 100%;
    }
    #results .category_option {
    display: inline-block;
    }
    #results td {
    padding: 2px;
    }
    #results .center {
    text-align: center;
    }[/code]
  • ZxurianZxurian Posts: 26Questions: 6Answers: 0
    I can PM you a link to the actual site if you want to check it out directly.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yes please :-)

    Allan
This discussion has been closed.