id or class method ?
id or class method ?
Philip Harvey
Posts: 23Questions: 0Answers: 0
I have a table set up with the 'id' method and all works well (except sorting, see my other post :-)) but as I understand it I can only have one table on a page. I have tried the 'class' method but that does not seem to respect the column width statements. I have used the "bAutoWidth": false statement.
Am I missing something ?
Regards
Phil
Am I missing something ?
Regards
Phil
This discussion has been closed.
Replies
You certainly can have multiple tables initialised from a single class - have a look at the example here: http://datatables.net/examples/example_multiple_tables.html . If this doesn't work for you, perhaps you can provide a link to your example.
Thanks,
Allan
Also if I specify a column width in a table using the 'id' method and then change to the 'class' method the columns are a lot wider... I think I will convert all my tables to the 'class' method and resize the columns as it looks and works well ... but it would be nice to have narrow tables when there is only a couple of columns to show.
Thanks for your patience
Phil
I see what you mean - thanks for clearing that up. One thing to note is that if you are using my demo CSS then you might well have:
[code]
table.display {
margin: 0 auto;
width: 100%;
clear: both;
}
[/code]
This would override the width="50%" in your HTML. it might be best to remove this CSS statement if you want to use the HTML defined statements. Firebug is ideal for figuring out where styles are coming from.
Allan