I need to go through array and add it’s values as table rows classes where table cells has “colspan=10”.
Here is my html:
<tbody>
<tr>
<td><a href="#"><img src=""></a></td>
<td width="100%" align="left" colspan="10"><a href="#">Anchor</a></td>
</tr>
<tr>
<td colspan="1" class="text"><img></td>
<td valign="top" nowrap="" align="right"><a href="#"><img src=""></a></td>
<td width="100%" align="left" colspan="9" class="smalltext"><a href="#" class="dottedlink">Anchor</a></td>
</tr>
<tr>
<td colspan="1" class="text"><img></td>
<td valign="top" nowrap="" align="right"><a href="#"><img src=""></a></td>
<td width="100%" align="left" colspan="9" class="smalltext"><a href="#" class="dottedlink">Anchor</a></td>
</tr>
<tr>
<td><a href="#"><img src=""></a></td>
<td width="100%" align="left" colspan="10"><a href="#">Anchor</a></td>
</tr>
</tbody>
Please help! I’m totally new in jquery
PS I can add the same class but not from array
This should do what you are asking for
Of course that is for educational purposes. In real life you would write the same code more concisely: