Okay, there is several things missing from your code.
- Move the from loop
- Add changes to the variables in code, so they update every time the loop is executed.
<table class="table">
<thead>
<th>No</th>
<th>Qty</th>
<th>Val1</th>
<th>Val2</th>
</thead>
<tbody>
<?php
$qty = 6;
$val1 = 1;
$no = 1;
while($no<=4) {
$val2 = $qty * $no;
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $qty; ?></td>
<td><?php echo $val1; ?></td>
<td><?php echo $val2; ?></td>
</tr>
<?php
$val1 += $qty;
$no++;
}
?>
</tbody>
</table>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…