table解决宽度问题

    用table做表格先看最小的有多个的是多少,一行要分多少个格,再通过colspan合并来实现各种复杂的表格,而td的宽最好用百分比控制,不然很难控制:

  部分代码:

  

 1   <tr><td colspan="22" class="bac">四、仪器设备检验结果</td></tr> 
 2          <tr class="test-items">
 3           <td  width="200" colspan="2">序号</td>
 4           <td  style="18%" colspan="4">检验项目</td>
 5           <td  style="18%" colspan="4">检验结果</td> 
 6           <td  style="18%" colspan="4">标准限值</td>
 7           <td  style="18%" colspan="4">结果判定</td>
 8           <td  style="18%" colspan="4">备注</td>
 9         </tr>
10          <tr class="test-items">
11           <td  width="200" colspan="2">1</td>
12           <td  style="18%" colspan="4">{{"--"}}</td>
13           <td  style="18%" colspan="4">{{"--"}}</td> 
14           <td  style="18%" colspan="4">{{"--"}}</td>
15           <td  style="18%" colspan="4">{{"--"}}</td>
16           <td  style="18%" colspan="4">{{"--"}}</td>
17         </tr>

  

原文地址:https://www.cnblogs.com/CMirs/p/14634318.html