0
I have this HTML structure:
<table>
<tr>
<th>Firstname</th>
<th><a>Lastname</a></th>
<th>Age</th>
</tr>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
</table>
I needed to apply CSS to <tr>
of all elements having the element <a>
. Does anyone know if you can do this in CSS?
It doesn’t work :( I had already tried
– Nagi
Want to use css only?
– N. Dias
@Nagi can use Jquery?
– N. Dias
not pq I would have to redo the function of the framework and put a Calback there would have problems ahead with updates.. am tempted with CSS I tried to put an onload on the element anything else :(
– Nagi
can tell me if there is a function in JQUERY that monitors html because it is added via $('table tbody'). html(RETURN); and I didn’t want to touch the framework
– Nagi
Take a look here https://stackoverflow.com/questions/15657686/jquery-event-detect-changes-to-the-html-text-of-a-div
– N. Dias
If you have a <a> inside the <th> do you want the <tr> to get a style is that it? Or do you want to style all the <a> inside the table? Currently only with CSS you can not change the Father’s style through the web.
– hugocsl
$('body'). on('Domsubtreemodified', 'table tbody tr', Function(){ // do your Stuff if($(this). find('. active'). length) { $(this). addClass('active_tr'); } }); @N.Days
– Nagi