How to modify inline CSS after page load?

0

Good,

I'm doing a query to the database, where there is a field that has html content. Inside this content there is a table, which has some inline CSS with a width defined in px.

I need to change the width property of the table to 100%; The problem is that I am displaying this code by php once it comes from the database.

In other words, in reality what he is doing is just this:

echo $dados;

All html code is within $ data. I tried to explain it more clearly ...

Thanks for the help.

Cumps.

    
asked by anonymous 27.09.2016 / 13:43

1 answer

3

If your table is printed inside another element that you have identified, you can use the find() method of Jquery to search only this element.

Example:

$( "#minhaDiv" ).find( "table" ).css( "width", "100%" ); 
    
27.09.2016 / 14:10