<table border="1" style="width:100%;border-collapse:collapse;"> <tr> <td width="100px" rowspan="3">titletd> <td colspan="4">name1td> <td colspan="23">name2td> <td colspan="8">name3td> <td colspan="8">name4td> <td>td> <td>td> <td>td> <td>td> <td>td> tr> <tr> <td colspan="4">name1td> <td colspan="23">name2td> <td colspan="8">name3td> <td colspan="8">name4td> <td>td> <td>td> <td>td> <td>td> <td>td> tr> <tr> <td colspan="2" >0td> <td colspan="2" >1td> <td colspan="2" >2td> <td colspan="2" >3td> <td colspan="2" >4td> <td colspan="2" >5td> <td colspan="2" >6td> <td colspan="2" >7td> <td colspan="2" >8td> <td colspan="2" >9td> <td colspan="2" >10td> <td colspan="2" >11td> <td colspan="2" >0td> <td colspan="2" >1td> <td colspan="2" >2td> <td colspan="2" >3td> <td colspan="2" >4td> <td colspan="2" >5td> <td colspan="2" >6td> <td colspan="2" >7td> <td colspan="2" >8td> <td colspan="2" >9td> <td colspan="2" >10td> <td colspan="2" >11td> tr> table>
在chrome 62中显示效果正常(name3宽度 == name4宽度),如图:
在firefox 57.2中显示异常,name4(占4格)和name3(占3.5格)列宽不一致,如图
解决方法,给table添加'table-layout=fixed'属性
<table border="1" style="table-layout:fixed;width:100%;border-collapse:collapse;"> <tr> <td width="100px" rowspan="3">titletd> <td colspan="4">name1td> <td colspan="23">name2td> <td colspan="8">name3td> <td colspan="8">name4td> <td>td> <td>td> <td>td> <td>td> <td>td> tr> <tr> <td colspan="4">name1td> <td colspan="23">name2td> <td colspan="8">name3td> <td colspan="8">name4td> <td>td> <td>td> <td>td> <td>td> <td>td> tr> <tr> <td colspan="2" >0td> <td colspan="2" >1td> <td colspan="2" >2td> <td colspan="2" >3td> <td colspan="2" >4td> <td colspan="2" >5td> <td colspan="2" >6td> <td colspan="2" >7td> <td colspan="2" >8td> <td colspan="2" >9td> <td colspan="2" >10td> <td colspan="2" >11td> <td colspan="2" >0td> <td colspan="2" >1td> <td colspan="2" >2td> <td colspan="2" >3td> <td colspan="2" >4td> <td colspan="2" >5td> <td colspan="2" >6td> <td colspan="2" >7td> <td colspan="2" >8td> <td colspan="2" >9td> <td colspan="2" >10td> <td colspan="2" >11td> tr> table>
chrome和firefox显示效果相同