Passing more than one class selector to multiple tables identified by

Passing more than one class selector to multiple tables identified by

ma_robergema_roberge Posts: 31Questions: 10Answers: 1

I am trying to implement the code found at http://www.datatables.net/examples/basic_init/multiple_tables.html, which uses the following:

<script type="text/javascript">
$(document).ready(function() {
    $('table.display').dataTable();
} );
</script>
...
<table id="" class="display" cellspacing="0" width="100%">

Since the class selector for my personal style is "compact cell-border hover", I tried the following, which consists in assigning my style declaration to a variable and passing it to the class selector, but it does not work.

<script type="text/javascript">
    var myTableStyle = "compact cell-border hover"
    $(document).ready(function() {
        $('table.myTableStyle').dataTable();
} );
</script>
...
<table id="" width="100%" class=myTableStyle>

To sum up: how does one use the multiple tables feature with a style other than one consisting of a single word?

This discussion has been closed.