您可以使用此代码:
<body>
<table><tr><td>
MAC Adress : </td><td><input type="text" name="mac-addr"></td><td>
<input type="submit" value="change"></td>
</tr><tr><td>IP Adress : </td><td><input type="text" name="ip-addr"></td><td>
<input type="submit" value="change"></td></tr>
<tr><td>Gateway Adress : </td><td><input type="text" name="gate-addr"></td><td>
<input type="submit" value="change"></td></tr>
<tr><td>Subnet Mask : </td><td><input type="text" name="sub-msk"></td><td>
<input type="submit" value="change"></td></tr><tr>
<td>Ntp Server IP : </td><td><input type="text" name="ntp-ip"></td><td>
<input type="submit" value="change"></td></td></table>
</body>
这是预览:http: //jsfiddle.net/Gn7aU/
更新 :
这是使用 div 订购商品的最佳方式:
<div class="tbl">
<div class="tbl-row">
<div class="tbl-cell">
MAC Adress :
</div>
<div class="tbl-cell">
<input type="text" name="mac-addr">
</div>
<div class="tbl-cell">
<input type="submit" value="change">
</div>
</div>
<div class="tbl-row">
<div class="tbl-cell">
IP Adress :
</div>
<div class="tbl-cell">
<input type="text" name="ip-addr">
</div>
<div class="tbl-cell">
<input type="submit" value="change">
</div>
</div>
<div class="tbl-row">
<div class="tbl-cell">
Gateway Adress :
</div>
<div class="tbl-cell">
<input type="text" name="gate-addr">
</div>
<div class="tbl-cell">
<input type="submit" value="change">
</div>
</div>
<div class="tbl-row">
<div class="tbl-cell">
Subnet Mask :
</div>
<div class="tbl-cell">
<input type="text" name="sub-msk">
</div>
<div class="tbl-cell">
<input type="submit" value="change">
</div>
</div>
<div class="tbl-row">
<div class="tbl-cell">
Ntp Server IP :
</div>
<div class="tbl-cell">
<input type="text" name="ntp-ip">
</div>
<div class="tbl-cell">
<input type="submit" value="change">
</div>
</div>
</div>
你应该为此添加css样式:
.tbl
{
display:table;
}
.tbl-row
{
display:table-row;
}
.tbl-cell
{
display:table-cell;
}
这是预览:http: //jsfiddle.net/aksVm/