Blank table in IE 7

Blank table in IE 7

dumkatdumkat Posts: 3Questions: 0Answers: 0
edited March 2010 in General
I am getting a blank table in IE 7 even though the table code is in the source code.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I think you are going to have to give us a bit more than that :-). This zero config example works fine for me in IE7: http://datatables.net/examples/basic_init/zero_config.html

    Allan
  • dumkatdumkat Posts: 3Questions: 0Answers: 0
    I figured it out. You can't use a class selector in IE 7

    i had
    $('.data_table').dataTable();

    that doesn't work

    $('#data_table').dataTable();

    does work.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You should be able to use class selectors in IE: http://datatables.net/examples/basic_init/multiple_tables.html .

    But you can call it twice - or you would be re-initialising the same table. ie.

    [code]
    // one table in DOM - then:
    $('.data_table').dataTable();

    // add another table - then:
    $('.data_table').dataTable();
    // init will fail since trying to re-init first table
    [/code]
    Allan
  • dumkatdumkat Posts: 3Questions: 0Answers: 0
    edited March 2010
    This is what i use to be able to use multiple datatables in most browsers. In IE7 it fails. I change selector to ID and it works. haven't tested on multiple tables on one page. class selector fails with just one table in IE7 too.
    [code]
    var datatable_checks=new Array();

    function addDataTable(){

    $('.data_table').each(function(){
    check_name=$(this).attr('id');

    if(!check_name){
    do{
    check_name="dtable"+Math.floor(Math.random()*1000000);
    }while(datatable_checks[check_name]);

    $(this).attr('id',check_name);
    }

    if(!datatable_checks[check_name]){
    tabl=$(this).dataTable({"bAutoWidth":false,"bStateSave": true,"sZeroRecords":"No records yet.","sPaginationType": "full_numbers"});
    datatable_checks[check_name]=1;
    }


    });


    }
    [/code]
This discussion has been closed.