Formatting a Datatable
Formatting a Datatable
Hello! I am new to DataTables as in this is the first time I have ever looked at the API at all. I am trying to build a dynamic table that is populated using a JavaScript array that I build from a backend data response. I am also using the response to build a columns array to feed to the datatable as well.
This table will serve as the payload of a widget. Yes I am aware that the table will be small but I need to do this none the less. I wil provide a method to blow the widget up to make the table more useful but that is another topic. My concern is that I am having a very difficult time controlling the height and width of the data table.
Note I am creating all of this dynamically, even the table element does not exist on the page until the user chooses to create a table widget. So to my actual question, how do I control the height and width of my datatable?
A full code example can be seen at this fiddle: http://jsfiddle.net/2ccgk/5/
I need that table to fit in to the widget which is outlined in black...any advice?
This table will serve as the payload of a widget. Yes I am aware that the table will be small but I need to do this none the less. I wil provide a method to blow the widget up to make the table more useful but that is another topic. My concern is that I am having a very difficult time controlling the height and width of the data table.
Note I am creating all of this dynamically, even the table element does not exist on the page until the user chooses to create a table widget. So to my actual question, how do I control the height and width of my datatable?
A full code example can be seen at this fiddle: http://jsfiddle.net/2ccgk/5/
I need that table to fit in to the widget which is outlined in black...any advice?
This discussion has been closed.
Replies