標籤:style color os 資料 width for
<table class="r_line" cellpadding="3" cellspacing="1" width="100%"> <tr class="r_title"> <td>編號</td> </tr><asp:Repeater ID="rptRecord" runat="server"> <ItemTemplate> <tr style=‘background-color:<%#(Container.ItemIndex%2==0)?"#fff":"#eee"%>‘> <td><a href=‘Detail.aspx?PID=<%=Request.QueryString["PID"] %>&did=<%#Eval("PID") %>‘><%#Eval("PID") %></a></td> </tr> </ItemTemplate> <FooterTemplate> <tr class="r_bg"> <td><asp:Label ID="lblEmpty" Text="無記錄.." runat="server" Visible=‘<%#bool.Parse((rptRecord.Items.Count==0).ToString())%>‘></asp:Label> </td> </tr> </FooterTemplate> </asp:Repeater></table>
上面是從網上看到的
我自己這麼寫的
<FooterTemplate> <% if (rptComunicateList_Untreated.Items.Count == 0) { %> <div class=‘infor-block‘ style=‘text-align: center; color: #999999;‘> <p> 沒有相關記錄! </p> </div> <%}%> </FooterTemplate>
沒啥含量,記錄下來以後多用到