ASP.NET - 在div之外流动的中继器

时间:2013-11-25 08:32:50

标签: .net html repeater html-table

我在 asp 中的 div 内的转发器中有

当填充转发器时,其中的一些表行在水平方向上太大,因此整个转发器宽度在DIV外部流动。

我尝试了一切,但没有任何作用。这是我的代码:

       <div>
     <asp:Repeater ID="RepeaterColors" runat="server">
      <HeaderTemplate>
       <table border="1" width="100%;"   >
         <tr>
         <th style="min-width: 62px; width: 62px;">Color Word ID</th>
         <th style="min-width: 62px; width: 62px;">Color English Meaning</th>
         <th style="min-width: 62px; width: 62px;"></th>
         <th style="min-width: 62px; width: 62px;"></th>
         </tr>
      </HeaderTemplate>      
      <ItemTemplate>
         <tr>  
         <td> <%# Eval("MsgColor_wordID")%></td>
         <td> <%# Eval("MsgColor_Eng")%></td>
         <td > <asp:LinkButton ID="BtnEdit" runat="server" ForeColor="#CC0000" CommandName="edit" CommandArgument = '<%#Eval("MsgColor_ID")%>' >Edit</asp:LinkButton></td>
         <td > <asp:LinkButton ID="BtnDelete" runat="server" ForeColor="#CC0000" CommandName="delete"  OnClientClick="return confirm('This record will be deleted. Proceed?')" CommandArgument = '<%#Eval("MsgColor_ID")%>' >Delete</asp:LinkButton></td>
         </tr>
      </ItemTemplate>
      <FooterTemplate>
         </table>
      </FooterTemplate>
      </asp:Repeater>
       </div>

此div和整个代码位于一个 div

<div id="container">

的CSS:

   #container
   {
       text-align:left;
       background:#fff;
       border:1px solid #ccc;
       margin:0 auto 10px auto;
       width:641px
   }

以下是大数据位于第一个单元格时的显示方式: (DIV是空格。)

enter image description here

0 个答案:

没有答案
相关问题