首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

跪求专家,DataList嵌套Repeater,包含的个数不等,不想要每行等高,去掉空白解决办法

2012-02-21 
跪求专家,DataList嵌套Repeater,包含的个数不等,不想要每行等高,去掉空白目前效果,不想数目不同时,行行中

跪求专家,DataList嵌套Repeater,包含的个数不等,不想要每行等高,去掉空白

目前效果,不想数目不同时,行行中间留下空白

想要的效果,紧凑一些

代码如下:

 

C# code
     <asp:DataList id="BigCategories" runat="server" RepeatColumns="5" ItemStyle-VerticalAlign="Top"  RepeatLayout="Table" RepeatDirection="Vertical"                OnItemDataBound="BigCategories_ItemDataBound">   <ItemTemplate>     <!--分类名称-->        <a class="newstitle" href='CatalogInfoList.aspx?catalogtop=<%# HttpUtility.UrlEncode(Eval("catalogtop").ToString()) %>'              target="_blank"><%# Eval("catalogtop") %></a>    <!--分类下的产品-->     <asp:Repeater ID="MinCategories" runat="server">       <ItemTemplate>         <a href='CatalogInfoList.aspx?catalogsub=<%# HttpUtility.UrlEncode(Eval("catalogsub").ToString()) %>' target="_blank"><%# Eval("catalogsub") %></a>      </ItemTemplate>     </asp:Repeater>   </ItemTemplate> </asp:DataList>   


[解决办法]
CSS code
#box{width:300px;background:#ccc;}.main{float:left;background:#fff;*height:30px;}.title{width:100px;height:15px;font-size:14px;color:#000;font-weight:bold;}.cont{width:100px;height:12px;font-size:12px;color:#ccc;} 

热点排行