次の html レンダリングが与えられます。
<fieldset id="fld_Rye">
<legend>7 Main St.</legend>
<div>
<table>
<tr>
<th class="wideCol"><b><i>Service Description</i></b></th>
<th class="wideCol"><b><i>Service Name</i></b></th>
<th class="normalPlusWidth"><b><i>Contact Name</i></b></th>
</tr>
<ItemTemplate>
<tr class="">
<td class="servDesc"> <b>Plumbing Services</b></td>
<td class="servName"> <b>Flynnsters's Plumbing</b></td>
<td class="servContact"> <b>Jim Flynnster</b></td>
</tr>
</ItemTemplate>
servDesc のクラスですべての td にアクセスし、それらの幅を配列に取得し、その配列から最大幅を取得して、ページの読み込み時に jquery を使用してそのクラスの css 幅をリセットしようとしています。これらのタグに適したセレクターが見つからないようで、少なくとも 50 のバリエーションを試しました。
私の最近の試み;
var maxTdWidth;
var servDescCols = [];
$("#fld_Rye td#servDesc").each(function () {
alert("found one");
servDescCols.push($(this).width());
});
maxTdWidth = Math.max.apply(Math, servDescCols);