I am using the following PHP code to print a table:
echo '<table> ';
echo '<tr>';
echo '<td> Cell 1';
echo '</td>';
echo '<td '.$myStyle.'> Cell 2';
echo '</td>';
echo '</tr>';
echo '</table> ';
$myStyle = 'style="color:red"';
My problem is the $myStyle cell attribute is not given to the cell unless if it is placed before it. Is there a way I can refresh the table after setting $myStyle so that the new attribute is taken? And I want it in a way where I keep my $myStyle variable.
use
jqueryORJavascripton client side to accomplish this.set an ID or class attribute of the target
tdthen apply the following jquery likehtml:
jquery: