表格单元格中不必要的填充 [英] Unwanted padding in table cell
问题描述
我有一个网页,该网页与设计视图中的显示不同.它在带有文本框的表格单元格周围添加填充,但除此之外没有其他地方.我想要它而没有填充.
I have a web page that does not appear as it does in design view. It adds padding around table cells with text boxes in, but nowhere else. I want it without the padding.
这是html:
<asp:Panel ID="PlayerPanel" runat="server" BackColor="#3333CC">
<table id="PlayerTable" style="width:100%;" border="0">
<tr>
<td >Name</td>
<td><asp:textbox id="txtPlayerName" runat="server" Width="400px" AutoPostBack="True"></asp:textbox></td>
</tr>
<tr>
<td >Mobile</td>
<td><asp:textbox id="txtPlayerMobile" runat="server" Width="400px" AutoPostBack="True" ></asp:textbox></td>
</tr>
<tr>
<td >Email</td>
<td><asp:textbox id="txtPlayerEmail" runat="server" Width="400px" AutoPostBack="True"></asp:textbox></td>
</tr>
</table>
</asp:Panel>
在设计中,它看起来没有填充.运行时,它会在文本框的上方和下方带有与文本框相同高度的填充.
In design, it appears without padding. When running, it appears with padding above and below the textbox of about the same height as the textbox.
我尝试为面板,表格和单元格设置"padding:0px;"
,但仍然保持不变.我还能尝试什么?
I have tried setting "padding:0px;"
for the panel, the table and the cell, but it still stays the same. What else can I try?
推荐答案
我找到了此修复程序:
p {
margin: 0;
padding: 0;
}
我将此添加到了CSS中,并解决了该问题.这就是那些嗯,du!"解决方案.
I added this into the css and it fixed the problem. It is one of those 'Well, duh!' solutions.
这篇关于表格单元格中不必要的填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!