在表之间添加一个小空格

时间:2015-06-08 20:36:57

标签: css asp.net html5 html-table repeater

我想要做的是在表格之间添加一个小空格。当我使用<p><br>时,空间太大。有谁知道如何在表之间创造一个非常小的空间?

这里的实际情况与我想要的情况相似:

Example

我在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>

2 个答案:

答案 0 :(得分:2)

您可以更改面板以包含底部边距。如此改变:

<asp:Panel ID="Panel3" runat="server" BackColor="#ffffff" Height="125px" Style="margin-left: 1px" Width="800px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">            

    <asp:Panel ID="Panel3" runat="server" BackColor="#ffffff" Height="125px" Style="margin-left: 1px;margin-bottom: 2px" Width="800px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">            

答案 1 :(得分:1)

设置面板的bottom margin