0
即使我已爲td
標籤設置了 寬度,但在Odo
和Location
列之間存在巨大差距。用於動態生成表格項目的單元格邊距
我有一個簡單的表:
<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>";
嘗試刪除表格寬度並添加表格邊框,看看你的dy namically生成的tr有任何額外的空間和使用trim()是這樣的.. –
感謝問題解決,也定義了動態列表相同的寬度。 –