zoukankan      html  css  js  c++  java
  • datalist 合并单元格 相同行合并

    // 合并单元格
    for (int i = ElectricYellowPage.Items.Count - 1; i > 0; i--)
    {
    HtmlTableCell oCell_previous = ElectricYellowPage.Items[i - 1].FindControl("tdnewCreat") as HtmlTableCell;
    HtmlTableCell oCell = ElectricYellowPage.Items[i].FindControl("tdnewCreat") as HtmlTableCell;

    oCell.RowSpan = (oCell.RowSpan == -1) ? 1 : oCell.RowSpan;
    oCell_previous.RowSpan = (oCell_previous.RowSpan == -1) ? 1 : oCell_previous.RowSpan;

    if (oCell.InnerText == oCell_previous.InnerText)
    {
    oCell.Visible = false;
    oCell_previous.RowSpan += oCell.RowSpan;
    }
    }

    前台:

    <div class="table-responsive" >
    <table class="table table-bordered table-condensed" >
    <asp:Repeater ID="ElectricYellowPage" runat="server" EnableViewState="False">
    <HeaderTemplate>
    <thead>
    <tr>
    <th colspan="6">电子黄页各区域新增、取消及收入情况</th>
    <th rowspan="2">当月新增完成情况</th>
    </tr>
    <tr>
    <th>地区</th>
    <th>当日新增</th>
    <th>当日取消</th>
    <th>当日在网数</th>
    <th>当月预计可结算金额</th>
    <th>ARPU</th>
    </tr>
    </thead>
    </HeaderTemplate>
    <ItemTemplate>
    <tr <%# GetColor( Eval("Area"))%>>
    <td><%#Eval("[Area]") %></td>
    <td style="text-align:right"><%#Eval("[DayNewCrease]") %></td>
    <td style="text-align:right"><%#Eval("[Daycancel]") %></td>
    <td style="text-align:right"><%#Eval("[DayInter]") %></td>
    <td style="text-align:right"><%#Eval("[ARPU]") %></td>
    <td style="text-align:right"><%#Eval("[ExpectedSettlement]") %></td>
    <%-- <td rowspan="<%=rowscount %>"></td> --%>
    <td id="tdnewCreat" runat="server" style="text-align:center;vertical-align:middle"><%#Eval("[NewCreatComplay]") %></td>
    </tr>
    </ItemTemplate>
    <%-- <FooterTemplate>
    <tr style="background-color:#FED966;" >
    <td>合计</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    </tr>
    </FooterTemplate> --%>
    </asp:Repeater>
    </table>
    </div>

  • 相关阅读:
    Spring Security
    用过sessionid防钓鱼
    request获取json
    相对于Statement,PreparedStatement的优点是什么?
    jquery中$.get()提交和$.post()提交有区别吗?
    相对于Statement,PreparedStatement的优点是什么?
    什么是Redis?
    如何解决表单提交的中文乱码问题
    execute,executeQuery,executeUpdate的区别是什么?
    根据你以往的经验简单叙述一下MYSQL的优化
  • 原文地址:https://www.cnblogs.com/lacey/p/5242049.html
Copyright © 2011-2022 走看看