【发布时间】:2015-08-23 11:29:45
【问题描述】:
我想做的是在我的桌子之间添加一个小空间。当我使用<p> 或<br> 时,空间太大了。有谁知道如何在表格之间留出很小的空间?
这是它的实际外观与我想要的外观:
我在 ASP:Panel 和中继器控件中执行此操作。
这是我的代码:
<asp:Repeater ID="AcctRepeater" runat="server" onitemcommand="AcctRepeater_ItemCommand" OnItemDataBound="AcctRepeater_DataBinding">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:Panel ID="Panel3" runat="server" BackColor="#ffffff" Height="125px" Style="margin-left: 1px" Width="800px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">
<table width="790">
<tr bgcolor="#007ACC" style="color:White">
<td width="100">Account Number</td><td width="80">DOS</td><td width="30">Active</td><td width="240">Account Group</td><td width="180">Function</td>
</tr>
<tr>
<td>
<asp:Label ID="lblAcctNum" runat="server" width="200px" Text='<%#Eval("UserName") %>'></asp:Label>
</td>
<td>
<asp:Label ID="lblDOS" runat="server" Text='<%#Eval("UserDOB", "{0:d}") %>'></asp:Label>
</td>
<td>
<asp:Label ID="lblActive" runat="server" width="30px" Text='<%#Eval("UserTitle") %>'></asp:Label>
</td>
<td>
<asp:Label ID="lblAcctGrp" runat="server" Text='<%#Eval("UserCity") %>'></asp:Label>
</td>
<td>
<!-- <asp:LinkButton ID="LinkEdit" runat="server" CommandArgument='<%#Eval("UserImg") %>' CommandName="edit">Edit</asp:LinkButton> -->
</td>
<tr>
<tr>
<td colspan = "2">
<asp:Label ID="Label1" runat="server" Text='Added/Loaded By: '></asp:Label><asp:Label ID="lblLoadBy" runat="server" Text='<%#Eval("UserState") %>'></asp:Label>
</td>
<td colspan ="3">
<asp:Label ID="Label3" runat="server" Text='Added/Loaded On: '></asp:Label><asp:Label ID="lblLoadedOn" runat="server" Text='<%#Eval("UserGender") %>'></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
</ItemTemplate>
<SeparatorTemplate>
</SeparatorTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
【问题讨论】:
-
无法对此进行测试,但您尝试过
<br>的地方<font size="4">&nbsp</font>会起作用吗? -
4 有点大,但即使我将其降为 1,它仍然与
和
标签的大小相同。 -
<p style="line-height:50%" />?
标签: css asp.net html html-table repeater