मुझे यह पोस्ट highlighting even columns पर दिखाई देता है लेकिन क्या मैं केवल चयनित कॉलम को हाइलाइट कर सकता हूं?jQuery केवल तालिका में चयनित कॉलम को हाइलाइट करते हुए
$("table.Table22 > tbody > tr > td:nth-child(even)").css("background","blue");
लेकिन मैं चाहते हैं: नोट:
यहाँ कोड वे का उपयोग है class="highlight"
चयनित स्तंभों पर होगा, इसलिए यदि मैं कॉलम 3 चयनित class="highlight"
स्तंभ 2 से हटा दिया और जोड़ा जाएगा कॉलम 3 पर। jQuery को चयनित कॉलम के आधार पर कक्षा जोड़ने की आवश्यकता है।
<table class="tbl">
<tr>
<th class="firstColumn">
Cell 1:Heading
</th>
<th class="highlight">
Selected column so this should be highlighted
</th>
<th>
Cell 3:Heading
</th>
<th>
Cell 4:Heading
</th>
<th>
Cell 5:Heading
</th>
</tr>
<tr>
<td>
Cell 1:Row 1
</td>
<td class="highlight">
Selected column so this should be highlighted
</td>
<td>
Cell 3:Row 1
</td>
<td>
Cell 4:Row 1
</td>
<td>
Cell 5:Row 1
</td>
</tr>
<tr>
<td>
Cell 1:Row 2
</td>
<td class="highlight">
Selected column so this should be highlighted
</td>
<td>
Cell 3:Row 2
</td>
<td>
Cell 4:Row 2
</td>
<td>
Cell 5:Row 2
</td>
</tr>
</table>
पर तालिका को एकीकृत करने के तरीके पर पूर्ण ट्यूटोरियल पढ़ सकते हैं। मुझे तालिका पसंद है लेकिन वास्तव में मैं एक तालिका के चयनित कॉलम में सीएसएस को बदलना चाहता हूं, लेकिन हालांकि मैं उदाहरण के लिए हाइलाइट का उपयोग करें। लेकिन प्लगइन बहुत जल्द मेरे वर्कस्पेस में जाएगा, धन्यवाद :) –
धन्यवाद यह वही है जो मुझे चाहिए। कोई अन्य मौका आप मेरे अन्य प्रश्न पर मदद कर सकते हैं? मैंने आपके कोड को भी इसमें जोड़ा है: http://stackoverflow.com/questions/1126489/jquery-examples-horizontal-accordion-table-instead-of-un-ordered-lists-upda –
प्लगइन ठीक काम करता है, हालांकि colspans समर्थित नहीं हैं - यह –