JavaScript、jQuery、またはその他の方法table
を使用して HTML 構造を変更する方法はありますか?div
<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>