lovablebox

学点东西...

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
实现repeater控件多列显示 只需在表格中加入
style="width:262px;height:120px; float:left;"
设置为表格的漂浮属性。注意要设定表格的长度和宽度。

 1<asp:repeater id="InfoList" Runat="server">
 2    <ItemTemplate>
 3            <table border="0" style="width:262px;height:120px; float:left;" cellpadding="0" cellspacing="0">
 4             <tr bgcolor="#ffffff">
 5                <td align="center" width="100" valign="top">
 6                   <table width="100" border="0" cellpadding="0" cellspacing="0">
 7                     <tr>
 8                          <td colspan="3"><img src="../images/information/analyze_top.gif" width="100" height="10"></td>
 9                     </tr>
10                     <tr>
11                          <td width="14"><img src="../images/information/analyze_left.gif" width="14" height="73"></td>
12                           <td width="73" align="center"><a target="_blank" href='/product/product_detail.aspx?ID=<%#DataBinder.Eval(Container.DataItem, "ID")%>'><img src='<%# getPic(DataBinder.Eval(Container.DataItem, "PicShow").ToString())%>' width="68" height="66" border="0"></a></td>
13                            <td width="13"><img src="../images/information/analyze_right.gif" width="13" height="73"></td>
14                       </tr>
15                        <tr>
16                            <td colspan="3"><img src="../images/information/analyze_foot.gif" width="100" height="13"></td>
17                        </tr>
18</table>
19</td>
20 <td class="smallblue" valign="top">
21                                                   <table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
22                                                            <tr>
23                                                                <td width="100%"><a href="#" class="orange"><%# getName(DataBinder.Eval(Container.DataItem, "ProductName").ToString(),DataBinder.Eval(Container.DataItem, "ID").ToString()) %></a></td>
24                                                            </tr>
25                                                            <tr>
26                                                                <td>
27                                                                    <a href='/company/companydetail.aspx?userid=<%# DataBinder.Eval(Container.DataItem, "MemberID").ToString() %>'>
28                                                                        <%# DataBinder.Eval(Container.DataItem, "CompanyName").ToString()%>
29                                                                    </a>
30                                                                    <br>
31                                                                    <%# DataBinder.Eval(Container.DataItem, "PubTime"%>
32                                                                    <br>
33                                                                    <a href='/mybusiness/memberinfo/net_card.aspx?userid=<%# DataBinder.Eval(Container.DataItem, "MemberID").ToString() %>'>
34                                                                        <%# DataBinder.Eval(Container.DataItem, "UserName"%>
35                                                                    </a>
36                                                                    <br>
37                                                                    <%# DataBinder.Eval(Container.DataItem, "Dist"%>
38                                                                </td>
39                                                            </tr>
40                                                        </table>
41                                                    </td>
42                                                </tr>
43                                            </table>
44                                        </ItemTemplate>
45                                    </asp:repeater>
posted on 2007-12-21 11:24  lovablebox  阅读(760)  评论(0编辑  收藏  举报