まず第一に、私は PHP に非常に慣れていないので、愚かな質問かもしれませんが、そこに行きます: html と php で次のコードを持つ 2 つのドロップダウン選択タグがあります。
<select>
<option value="default">---a---</option>
<?php for($i=1; $i<+100; $i++) { ?>
<option value="<?php $i ?>"><?php echo $i ?></option>
<?php } ?>
</select>
<select>
<option value="default">---b---</option>
<?php for($j=1; $j<=100; $j++) { ?>
<option value="<?php $j ?>"><?php echo $j ?></option>
<?php } ?>
</select>
次に、行と列を持つテーブルがあります(少なくとも、変更する必要があります):
<table>
<tr>
<th>Date</th>
<th>Temp</th>
<th>Nr a</th>
<th colspan="2">a 1</th>
<!--another th___nr a-->
</tr>
<tr>
<td colspan="3"> </td>
<th>something</th>
<th>else</th>
<!--another something else___nr a-->
</tr>
<tr>
<td>
<?php
//echo date(DATE_RFC822);
echo date('jS\, F\, Y');
?>
</td>
<td>
<input type="number" name="temp" placeholder="temp" />
</td>
<th>b 1</th>
<td>
<input type="number" name="something" placeholder="something" />
</td>
<td>
<input type="number" name="else" placeholder="else" />
</td>
<!--another td___nr a-->
</tr>
<!--another tr___nr b-->
</table>
私がやりたいことは、最初のドロップダウンで a の数 (列) を制御し、2 番目のドロップダウンで b の数 (行) を制御することです。これは PHP で可能ですか。
ドロップダウンで選択した数値を変数に記憶し、それを解決するためにいくつかの for を使用することをどうにかして考えていましたが、それが可能であれば、それを行う方法が本当にわかりません。
私を助けてくれてありがとうございました:)