Setting column width

Setting column width

Andreas85Andreas85 Posts: 12Questions: 0Answers: 0
edited April 2011 in General
var oTable = $('#warehouse_table').dataTable( {
"aoColumnDefs": [
{ "sWidth": "600px", "aTargets": [ 0 ] }
],
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"bStateSave": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "S

Replies

  • AlawrenceAlawrence Posts: 18Questions: 0Answers: 0
    Are you defining a size in your table headers?
  • Andreas85Andreas85 Posts: 12Questions: 0Answers: 0
    No.
  • Andreas85Andreas85 Posts: 12Questions: 0Answers: 0
    If this is what you mean. Not defining any sizes here. I've tried doing that aswell, but didn't work.




     
    Typ
    Skick
  • AlawrenceAlawrence Posts: 18Questions: 0Answers: 0
    Try something like this:

    [code]Entry Date[/code]
  • Andreas85Andreas85 Posts: 12Questions: 0Answers: 0
    Nope, that didn't work either.
  • Andreas85Andreas85 Posts: 12Questions: 0Answers: 0
    After tinkering with my code a bit I found that if the table is small with only 5 columns for example, setting width works perfectly. But now I want to have 16 columns in my table and as soon as I add that many setting width stops working. Any idea how to fix this?
  • Andreas85Andreas85 Posts: 12Questions: 0Answers: 0
    Now I set
    style="width:2000px"
    on my table and now it seems to work
  • AlawrenceAlawrence Posts: 18Questions: 0Answers: 0
    Cool you got it to work. Yes after a certain point pixel size must be used in place of the percent.
This discussion has been closed.