How to add cellspacing="0" if it's not available for any <table> using jquery?
and if it's available and it has any other value than ="0" then want to convert it to ="0"
$('table').attr("cellspacing", 0);
Will change every table's cellspacing attribute to 0, whether it was previously defined or not.
Starting HTML:
<table> ... </table>
<table cellspacing="5" cellpadding="5"> ... </table>
Resulting HTML:
<table cellspacing="0"> ... </table>
<table cellspacing="0" cellpadding="5"> ... </table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With