2011-05-31 45 views
0

我想增加标题行和表中第一行之间的空间。我该怎么做呢?表 - 增加标题和第一行之间的空间

我有以下几点:

<asp:Repeater ID="myRepeater" runat="server" > 
    <HeaderTemplate> 
     <table style="width:100%;" border="0" cellpadding="0" cellspacing="0"> 
      <thead> 
       <tr align="left"> 
         <th style="width:15%"> 
          Column 1 
         </th> 
         <th style="width:15%"> 
          Column 2 
         </th> 
         <th style="width:15%"> 
          Column 3 
         </th>        
        </tr> 
       </thead> 
     </HeaderTemplate> 
     <ItemTemplate> 
       <tbody style="padding-top: 50px;"> 
        <tr> 
         <td></td> 
         <td></td> 
         <td></td> 
        </tr>       
       </tbody> 
     </ItemTemplate> 
     <SeparatorTemplate> 
      <tr style="padding-bottom: 30px;"> 
       <td colspan="7" style="padding-bottom: 20px; padding-top: 20px;"> 
        <hr style="width:100%" /></td> 
      </tr> 
     </SeparatorTemplate> 
     <FooterTemplate> 
      </table> 
     </FooterTemplate> 
    </asp:Repeater> 

正如你可以看到我已经添加<style="padding-top: 50px;"> 表体,但这不起作用。

回答

0

不知道,但也许:

thead{padding-bottom:2em;} 

会给你你想要的结果。

+0

不能将填充应用到'thead'元素,给它一个测试,什么都不会发生,就像你无法填充'tr'或'tbody'一样 – 2011-05-31 12:41:13

0

最简单的方法是将填充添加到<th>元素

<th style="width:15% padding-bottom: 50px"> 
    Column 1 
</th> 
<th style="width:15% padding-bottom: 50px"> 
    Column 2 
</th> 
<th style="width:15%; padding-bottom: 50px"> 
    Column 3 
</th> 

注意的底部:这是很好的测试目的,但是这真的应该在样式表直接在HTML完成的,而不是。

th { 
    padding-bottom: 50px; 
} 
相关问题