7
I’m making changes in a pagina.aspx
of a system, however many things are generated through language functions.
Since I can’t add a class via code, I’m trying to add via jQuery, but I’m not getting it, below is an example of a code snippet.
<table id="ctl19_tableAreas" style="height:100%;width:100%">
<tbody>
<tr style="height:249px;">
<td style="width:33%;padding-top:20px;" valign="top">
</td>
<td style="width:33%;padding-top:20px;" valign="top">
</td>
<td style="width:33%;padding-top:20px;" valign="top">
</td>
</tr>
</tbody>
</table>
So my question is how do I add a class to these columns:
style=width:33%;
padding-top:20px;
valign=top
It can not be for all because within each has other tables, a total confusion.
$('#ctl19_tableAreas td').addClass('a_tua_classe');
should be enough to add the class. Can you explain better why you need the class and what you want to do? and also bring jQuery together to better understand the context.– Sergio
I’ve already done this, the problem is that it will add the class in all td, and within td there are other tables. Need to add this class in order to be able to format 4 columns via css
– Sérgio Machado
If you use
'#ctl19_tableAreas > tbody > tr > td'
on the selector this will only select thetd
"1st generation" and not other tables within that first generation. That’s what you want?– Sergio
I find very viable the answer of @Pedrocamarajunior
– Danilo Pádua
Exactly this I will, test a colleague’s solution posted below
– Sérgio Machado
Sergio, it worked perfectly as I wanted, thank you very much
– Sérgio Machado