私はPHPでループしてテーブルを作成しました。つまり、テーブルの行数は動的になります(1,2,3,4,5など)。 私は最後にそれを各行に入れておきます。フォーカスすると、以前のtdの値がすべて計算され、最後に表示されます。Jqueryとテーブルの操作
<select name="number" id="number" onchange="document.form2.submit()">
<? for($j=1;$j<=5;$j++) {?>
<option value="<?=$j ?>" <?=($j==$_REQUEST['number'])?'selected':'' ?>><?=$j ?></option>
<? } $num=$_REQUEST['number']; ?>
</select>
<table width="100%" border="0" cellpadding="4" cellspacing="5" id="mytable">
<thead>
<tr>
<th width="35%">Length</th>
<th width="36%">Width</th>
<th width="29%">Area</th>
</tr>
</thead>
<tbody>
<? for($i=0;$i<$num;$i++) {?>
<tr class="row">
<td><input type="text" name="length" class="textbox" id="length"/></td>
<td><input type="text" name="width" class="textbox" id="width" /></td>
<td><input type="text" name="area" class="textbox" id="area" onfocus="" /></td>
</tr>
<? } ?>
</tbody>
</table>
各行の最後のtdを選択するコードを入力してください。 私は多くを試みたが成功しなかっyet.Allヘルプが途中で...
あなたはフォーカスとはどういう意味ですか?フォーカスは、要素を入力するために行うことです。 「クリックする」を意味する場合、クリックする前に表示されるものは? PHPの "領域"を計算してhtmlに入れるだけの理由はありますか? – Sinetheta
http://cssglobe.com/lab/tablecloth/ –