weird inline style added to table

weird inline style added to table

ptvwptvw Posts: 1Questions: 0Answers: 0
edited November 2010 in General
Hi -

I have a curious problem. I have a form which has some data validation, when it fails and I attempt to view the data table by clicking the other tab, the data table becomes centered and much smaller in width.

I have tried removing the error validation but the same thing occurs. I have traced it to an inline style that seems to be inserted which reads style="width: 0px" for my table.

This style though is not present in the source code of the page and seems to be added dynamically from somewhere.

Does anyone know why this is and how i could stop it?

I have tried overriding the style but it doesnt seem to work.

Replies

  • cjohnsoncjohnson Posts: 1Questions: 0Answers: 0
    edited March 2011
    I ran into this issue as well, and found my solution here:

    http://datatables.net/forums/comments.php?DiscussionID=2562

    In my webpage I have a clickable menu, which when the user clicks on a menu item, a hidden div is made visible. The div contains the datatable.. Like the above forum link shows, this is why the table is assigned an inline-style width of 0px.

    Once my div is made visible, i simply use JQuery to adjust the width of the table:

    [code]
    //make div visible/hidden
    $('#inform-add-group-div').toggle('slow', function(){
    //if div visible
    if($(this).is(':visible')){
    //adjust table's width
    $('#inform-add-grp-user-list-table').css('width', '100%');
    }
    });
    [/code]
This discussion has been closed.