$(document).ready(function(){
$('th').parent().addClass('table-header');
$('tr:not([th]):odd').addClass('odd');
$('tr:not([th]):even').addClass('even');
$('td:contains("Jude")').next().addClass('top40');
});
Selected cell is cell that have "Jude" text. But, we modify style cell after this cell.
| Series this article: jQuery - Selectors: Understanding The $() Factory Function jQuery - Selector: Modifying Style at List Item Levels jQuery - Selector: Styling Sub Level Item jQuery - Selector: XPath Selectors jQuery - Selector: Custom Selectors jQuery - Selector: Choose a Style at Custom Selectors jQuery - Selector: Modify Style for Table Header jQuery - Selector: Styling Sibling jQuery - Selector: Styling Next Cell Tag: jQuery, $(), factory, function, selectors, custom selectors, table, style, cell Category: JavaScript Post : March 21st 2008 Read: 2,212 blog comments powered by Disqus |