用户名:  密码:
兄弟在线   

标题:repeater 实现单行与总行的比较

作者:agui005 来源:http://www.xdlmn.com 时间:2012-06-22

<table cellpadding="0" cellspacing="0" border="0" class="Overall">
      <tr>
        <td class="indexconter_1012" valign="top"><!--中间的表格-->
            <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="dataform" style="margin-top:5px">
              <thead>
                <tr>
                  <td width="8%" rowspan="2" class="titleindex">指标分类</td>
                  <td width="17%" rowspan="2" class="titleindex">指标名称</td>
                  <td colspan="3" class="titleindex">2012年</td>
                  <td colspan="3" class="titleindex">2季度</td>
                  <td colspan="3" class="titleindex">5月份</td>
                  <td width="8%" class="titleindex">&nbsp;</td>
                </tr>
                <tr>
                  <td width="8%" class="titleindex">目标</td>
                  <td width="8%" class="titleindex">实际</td>
                  <td width="8%" class="titleindex">完成率</td>
                  <td width="7%" class="titleindex">目标</td>
                  <td class="titleindex" style="width: 7%">实际</td>
                  <td width="7%" class="titleindex">完成率</td>
                  <td width="7%" class="titleindex">目标</td>
                  <td width="7%" class="titleindex">实际</td>
                  <td width="8%" class="titleindex">完成率</td>
                  <td class="titleindex">沟通交流</td>
                </tr>
              </thead>
              <tbody id="senfe">
              <!--成本的表格-->
            <asp:Repeater ID="Repeater1" runat="server">
             <ItemTemplate>
                  <tr class="titleconter">
                  <td class="titleleft" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>" > <%# (Container.ItemIndex + 1) * 2 - RowCount1 == 1 ? Eval("KPI_TYPE") : "&nbsp;"%> <%# (Container.ItemIndex + 1) * 2 - RowCount1 == 0 ? Eval("KPI_TYPE") : "&nbsp;"%>  </td>
                  <td class="titleleft" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><a href="#"     style="font-weight:bold;"><%# Eval("KPINAME") %></a></td>
                  <td class="aline"  style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("YEAY_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("YEAY_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("YEAY_IS_COMPLETE")) %>"><%# Eval("YEAY_COMPLETION_RATE")%></div></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("QUARTER_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("QUARTER_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("QUARTER_IS_COMPLETE")) %>"><%# Eval("QUARTER_COMPLETION_RATE")%></div></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("MONTH_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("MONTH_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("MONTH_IS_COMPLETE")) %>"><%# Eval("MONTH_COMPLETION_RATE")%></div></td>
                  <td  style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><a href="#"  ><img src="../../../lbdui/images/user_comment.png" border="0"   alt="沟通交流" /></a></td>
                </tr>
                </ItemTemplate>
            </asp:Repeater>
            <!--交付的表格-->
            <asp:Repeater ID="Repeater2" runat="server">
             <ItemTemplate>
                  <tr class="titleconter">
                  <td class="titleleft" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>" > <%# (Container.ItemIndex + 1) * 2 - RowCount1 == 1 ? Eval("KPI_TYPE") : "&nbsp;"%> <%# (Container.ItemIndex + 1) * 2 - RowCount1 == 0 ? Eval("KPI_TYPE") : "&nbsp;"%>  </td>
                  <td class="titleleft" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><a href="#"     style="font-weight:bold;"><%# Eval("KPINAME") %></a></td>
                  <td class="aline"  style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("YEAY_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("YEAY_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("YEAY_IS_COMPLETE")) %>"><%# Eval("YEAY_COMPLETION_RATE")%></div></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("QUARTER_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("QUARTER_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("QUARTER_IS_COMPLETE")) %>"><%# Eval("QUARTER_COMPLETION_RATE")%></div></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("MONTH_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("MONTH_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("MONTH_IS_COMPLETE")) %>"><%# Eval("MONTH_COMPLETION_RATE")%></div></td>
                  <td  style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><a href="#"  ><img src="../../../lbdui/images/user_comment.png" border="0"   alt="沟通交流" /></a></td>
                </tr>
                </ItemTemplate>
            </asp:Repeater>
               
            <!--质量的表格-->
            <asp:Repeater ID="Repeater3" runat="server">
             <ItemTemplate>
                  <tr class="titleconter">
                  <td class="titleleft" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>" > <%# (Container.ItemIndex + 1) * 2 - RowCount1 == 1 ? Eval("KPI_TYPE") : "&nbsp;"%> <%# (Container.ItemIndex + 1) * 2 - RowCount1 == 0 ? Eval("KPI_TYPE") : "&nbsp;"%>  </td>
                  <td class="titleleft" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><a href="#"     style="font-weight:bold;"><%# Eval("KPINAME") %></a></td>
                  <td class="aline"  style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("YEAY_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("YEAY_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("YEAY_IS_COMPLETE")) %>"><%# Eval("YEAY_COMPLETION_RATE")%></div></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("QUARTER_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("QUARTER_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("QUARTER_IS_COMPLETE")) %>"><%# Eval("QUARTER_COMPLETION_RATE")%></div></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("MONTH_KPITARGET")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><%# Eval("MONTH_KPIXVALUE")%></td>
                  <td class="aline" style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><div class="<%# getRGB(Eval("MONTH_IS_COMPLETE")) %>"><%# Eval("MONTH_COMPLETION_RATE")%></div></td>
                  <td  style="<%# Container.ItemIndex + 1 == RowCount1 ? "border-bottom:1px #98b2cb solid;" : "" %>"><a href="#"  ><img src="../../../lbdui/images/user_comment.png" border="0"   alt="沟通交流" /></a></td>
                </tr>
                </ItemTemplate>
            </asp:Repeater>
                    
               
                 
              </tbody>
            </table>
          <!--中间的表格结束-->

        </td>
      </tr>
    </table>


cs

public string getRGB(Object obj)
        {
            if (obj.ToString() == "2")
            {
                return "btn_green";
            }
            else if (obj.ToString() == "1")
            {
                return "btn_yellow";
            }
            else if (obj.ToString() == "0")
            {
                return "btn_red";

            }
            else
            {
                return "btn_green";
            }
        }



总点击 [2148]   评论  0 查看评论
上一篇:正则表达式限制文本框只能输入数字
下一篇:ASP.NET 设置 a href连接的可用不可用
【关闭窗口】
您可能感兴趣的文章
我要评论
          
评论标题:   可以输入250
 
验证数字: 2 + 3 =
兄弟友情提示
· 请自觉遵守国家有关法律、法规,尊重网上道德。
· 兄弟在线坚决抵制不良言行,违者文责自负。
· 如果文章有版权或其他问题等,请联系我们,我们会尽快处理。
· 文章注名来自网络的旨在传播共享信息,不做其它用途;注名原创的本站支持原创,但不代表同意其观点。
· 兄弟在线拥有管理用户与其文章和评论的一切权利,并有权在网站内转载或引用。
兄弟在线
兄弟热门文章
兄弟推荐文章
兄弟站内搜索

兄弟感兴趣的文章
兄弟最新影视