Turning off width: 100%

Turning off width: 100%

rplankyrplanky Posts: 2Questions: 0Answers: 0
edited December 2013 in General
I've read a lot of forum postings that seem to have the opposite problem that I have: I do not want my table to take up 100% of the browser if it doesn't have to. Here's a simple table:
[code]
12
AB
[/code]

If I [code]$(document).ready(function() { $('#t1').dataTable( ...[/code] on it, it takes up the whole browser. I tried setting [code]bAutoWidth: false[/code] but this doesn't change the behavior. This has got to be a noob question, but it's almost like no one wants to do that? If I have a naturally 300px-wide table, I want it to be that wide.

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    http://datatables.net/release-datatables/examples/basic_init/flexible_width.html
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    @rplanky: Can you link us to the page please? The table will only take up 100% width if told to do so in the CSS or HTML.

    Allan
  • rplankyrplanky Posts: 2Questions: 0Answers: 0
    I found the table { width: 100% } in the dataTables.css ... removing it fixes my problem. I hope I remember to do that again the next time I upgrade :)
This discussion has been closed.