私はそのようなhtmlテーブルを持っています:
<div class="1233">hello</div>
<table cellpadding="0" cellspasing="0" class="sortable zebra tablesorter tablesorter-default"
id="articles-table">
<thead>
<tr class="tablesorter-headerRow">
<th data-column="0" class="tablesorter-header">
<div class="tablesorter-header-inner">Производитель<i class="tablesorter-icon"></i>
</div>
</th>
<th data-column="1" class="tablesorter-header">
<div class="tablesorter-header-inner">Артикул<i class="tablesorter-icon"></i>
</div>
</th>
<th data-column="2" class="tablesorter-header">
<div class="tablesorter-header-inner">Описание<i class="tablesorter-icon"></i>
</div>
</th>
<th data-column="3" class="tablesorter-header">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i>
</div>
</th>
<th class="prcol tablesorter-header tablesorter-headerSortDown" data-column="4">
<div class="tablesorter-header-inner">Цена<i class="tablesorter-icon"></i>
</div>
</th>
<th data-column="5" class="tablesorter-header">
<div class="tablesorter-header-inner">Наличие<i class="tablesorter-icon"></i>
</div>
</th>
<th data-column="6" class="tablesorter-header">
<div class="tablesorter-header-inner">Сроки поставки<i class="tablesorter-icon"></i>
</div>
</th>
<th data-column="7" class="tablesorter-header">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i>
</div>
</th>
</tr>
</thead>
<tbody class="analogs_art">
<tr class="zebra-stripe zebra-grey zebra2 even">
<td>
<h5>Knecht</h5>
</td>
<td>
<h4>OC90</h4>
</td>
<td style="max-width: 300px;">(07786171)Фильтр масл OPEL (07786171)Фильтр масл OPEL</td>
<td></td>
<td>6124</td>
<td>20</td>
<td>0-1</td>
<td id="to_cart_and_qnt_td">
<form accept-charset="UTF-8" action="/line_items" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓">
<input name="authenticity_token" type="hidden" value="0jlRLSkDKi6eM5SSL+3uRB0w2G141KUcJKuy4Bg2YNo=">
</div>
<input id="ART" name="ART" type="hidden" value="y1M1ZtdXgnMe6pOjjuXWPqhYR41SmQRKzlDOQ1uPwuru+AamPGpcOwOFFylbRDu5M1XUawCnukqNDQCuIr0JPA==--vNGx6/lYKRrpD5NGTJALcQ==">
<input id="price" name="price" type="hidden" value="TodzvfOZCbK5T9+RLE1IQg==--qq8o30c5rTX91F8W42wdsQ==">
<input id="distributor_id" name="distributor_id" type="hidden" value="6">
<input id="waittime" name="waittime" type="hidden" value="1">
<input class="qnt_to_cart2" id="OC90" name="cart_quantity" pattern="0|[1-9]\d{0,2}"
required="required" type="text" value="1">
<input class="orange-button to-cart_no" id="OC90" name="commit" type="submit"
value="В корзину">
</form>
</td>
</tr>
<tr class="zebra-stripe zebra-grey zebra2 odd">
<td>
<h5>KNECHT</h5>
</td>
<td>
<h4>OC 90</h4>
</td>
<td style="max-width: 300px;">Масляный фильтр</td>
<td> <a href="/articles/1248525/details" class="details-link">подробнее</a>
<a
href="/articles/1248525" class="analogs-link">аналоги</a>
</td>
<td>6124</td>
<td>20</td>
<td>0-1</td>
<td id="to_cart_and_qnt_td">
<form accept-charset="UTF-8" action="/line_items" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓">
<input name="authenticity_token" type="hidden" value="0jlRLSkDKi6eM5SSL+3uRB0w2G141KUcJKuy4Bg2YNo=">
</div>
<input id="ART" name="ART" type="hidden" value="9x6mdLbW2aMaHqFK32kZwHWnWA7n0GBp/jXS8KeECsTS+78ytG0SQzFpVODplws5iHm6B6SkZzi3ej2+zpW8iQ==--RNoUUgcZu7MLU8BHJ4ynSQ==">
<input id="price" name="price" type="hidden" value="VqatEYzkPEf3P9Y/jNY9Zg==--Iw5nQDqjK9vvZX/RecD1eA==">
<input id="distributor_id" name="distributor_id" type="hidden" value="6">
<input id="waittime" name="waittime" type="hidden" value="1">
<input class="qnt_to_cart" id="cart_quantity" name="cart_quantity" pattern="0|[1-9]\d{0,2}"
required="required" type="text" value="1">
<input class="orange-button to-cart" name="commit" type="submit" value="В корзину">
</form>
</td>
</tr>
<tr class="zebra-stripe zebra-grey zebra1 even">
<td>
<h5>Knecht</h5>
</td>
<td>
<h4>OC90</h4>
</td>
<td style="max-width: 300px;">Фильтр масляный OPEL/GM/DAEWOO Фильтр масляный OPEL/GM/DAEWOO</td>
<td></td>
<td>6142</td>
<td>1000</td>
<td>3</td>
<td id="to_cart_and_qnt_td">
<form accept-charset="UTF-8" action="/line_items" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓">
<input name="authenticity_token" type="hidden" value="0jlRLSkDKi6eM5SSL+3uRB0w2G141KUcJKuy4Bg2YNo=">
</div>
<input id="ART" name="ART" type="hidden" value="NqgWSvcdv0FEQkjcJZp98gIYe20Fjol8Bn31tB/CjWnTFVsa3J3hmldO1RSqS/pNUcVZ5dh0wcP7YeZxPAkQc4DEPKy7EVuTpMw3oQw58T0=--/XCn0hP3w0mglJ1vTXSjHw==">
<input id="price" name="price" type="hidden" value="mFPLSHh7AdEMpQJiZHFKNg==--hfJQGWhjBoD6mNAetXZ3Xw==">
<input id="distributor_id" name="distributor_id" type="hidden" value="6">
<input id="waittime" name="waittime" type="hidden" value="3">
<input class="qnt_to_cart2" id="OC90" name="cart_quantity" pattern="0|[1-9]\d{0,2}"
required="required" type="text" value="1">
<input class="orange-button to-cart_no" id="OC90" name="commit" type="submit"
value="В корзину">
</form>
</td>
</tr>
</tbody>
</table>
私のjscriptでの方法:
if(tr.not('.details-link')){
class = details-link を持っていないような td を放っておくことができますか? 今、私のコードは機能していません....
コードの編集をスキップして、tr にクラスがない場合に何かを行う....これを行う方法は?
upd これを行う必要があります: http://jsfiddle.net/zvKSc/8/
重複を削除するには(小文字を使用して1、2、5列、スペースを削除することは等しくなければなりません...)、tdの1つにクラスの詳細リンクがあるtrなどのページに残します...したがって、3つのiからのフィドルで最初に削除し、2 番目と 3 番目の tr を残す必要があります