0

即使我设置了标签的宽度Odo,列之间也有很大的边距。Locationtd

我有一个简单的表:

<table width="95%" border="0" cellspacing="0" cellpadding="2">
       <tr>
        <td width="18%" style="padding-left: 15px">Date</td>
        <td width="16%">Type</td>
        <td width="16%">Odo</td>
        <td width="20%">Location</td>
        <td width="46%">Remark</td>
      </tr>
      {ITEMSLIST}
</table>

我上面的项目列表是这样动态的:

itemList += "<tr><td align='left' style='font-size:8px; color:#03F;padding-left: 15px'>"
                                +displayFormat.format(idate)+ "</td><td style='font-size:8px; color:#03F'>"
+ cur2.getString(0)+ " Practicle</td><td style='font-size:8px; color:#03F'>"
+ "200"+ "</td><td style='font-size:8px; color:#03F'>"
+ location+ "</td><td style='font-size:8px; color:#03F'>"
+ cur2.getString(3) + "</td></tr>";
4

1 回答 1

0

我明确需要为所有动态生成的td标签定义宽度,结果很好-

itemList += "<tr><td align='left'  width='18%' style='font-size:8px; color:#03F;padding-left: 15px; '>"+displayFormat.format(idate)
    + "</td><td width='16%' style='font-size:8px; color:#03F'>"
    + cur2.getString(0)+ " Practicle</td><td width='16%' style='font-size:8px; color:#03F'>"
    + "200"+ "</td><td width='20%' style='font-size:8px; color:#03F'>"
    + location
    + "</td><td width='46%' style='font-size:8px; color:#03F'>"
    + cur2.getString(3) + "</td></tr>";
于 2013-04-17T13:06:33.773 回答