zoukankan      html  css  js  c++  java
  • 设置datalist指定行的背景色

    前台:

    <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>

    后台:

    public string GetColor(object name) {
    string ChannelName=Convert.ToString(name);

    if (ChannelName == "合计" || ChannelName == "总计")
    {
    return "style='background-Color:#FED966;'";
    }
    else if (ChannelName == "短信" || ChannelName == "客户端" || ChannelName == "外呼" || ChannelName == "小计")
    {
    return "style='background-Color:#D0CECF;'";
    }
    else {
    return "";
    }

    }

  • 相关阅读:
    一句SQL查询没门课程都低于80分的学生信息
    ★查询给定字符串中,出现最多的字符和出现的次数
    Eclipse自动加载源码----Attach Java Source
    Eclipse 修改workspace默认的字符集为 utf-8
    浅谈 Spring的AOP的实现 -- 动态代理
    浅谈高并发的理解
    为什么使用单例模式?
    正排索引 与 倒排索引
    图片裁剪
    微信小程序开发笔记
  • 原文地址:https://www.cnblogs.com/lacey/p/5242023.html
Copyright © 2011-2022 走看看