有没有办法将 HTML 结构从table
使用div
JavaScript、jQuery 或任何其他方式更改?
<table cellspacing="0" cellpadding="0" border="1" style="width: 500px; ">
<tbody>
<tr><td><strong>CONNECTORS</strong></td><td> </td></tr>
<tr><td>USB:</td><td>AMC</td></tr>
<tr><td>Gigabit Ethernet:</td><td>AMC</td></tr>
<tr><td>VGA:</td><td>AMC</td></tr>
<tr><td>RS232:</td><td>AMC</td></tr>
<tr><td> </td><td> </td></tr>
<tr><td><strong>PHYSICAL CHARACTERISTICS</strong></td><td> </td></tr>
<tr><td>Dimensions:</td><td>220 x 88 x 280mm (WxHxD)</td></tr>
<tr><td>Weight:</td><td>4,6kg</td></tr>
<tr><td>Color:</td><td> Green, other optional</td></tr>
<tr><td> </td><td> </td></tr>
</tbody>
所以破解后它应该是这样的:
<div style="width:500px">
<div class="block">
<div><strong>CONNECTORS</strong></div>
<div class="lft">USB:</div><div class="rght">AMC</div>
<div class="lft">Gigabit Eithernet</div><div class="rght">AMC</div>
<div class="lft">VGA:</div><div class="rght">AMC</div>
<div class="lft">RS232:</div><div class="rght">AMC</div>
</div>
<div class="block">
<div><strong>PHYSICAL CHARACTERS</strong></div>
<div class="lft">Dimensions</div><div class="rght">220 x 88 x 280mm (WxHxD)</div>
<div class="lft">weight:</div><div class="rght">AMC</div>
<div class="lft">Color:</div><div class="rght">AMC</div>
<div class="lft">power:</div><div class="rght">9-32VDC</div>
</div>
</div>