循环遍历泛型集合List绑定到table
<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="Default4.aspx.cs" Inherits="Default4" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<style>
table { background:#D3E4E5;
border:1px solid gray;
border-collapse:collapse;
color:#fff;
font:normal 12px verdana, arial, helvetica, sans-serif;
}
caption { border:1px solid #5C443A;
color:#5C443A;
font-weight:bold;
letter-spacing:20px;
padding:6px 4px 8px 0px;
text-align:center;
text-transform:uppercase;
}
td, th { color:#;
padding:.4em;
}
tr { border:1px dotted gray;
}
thead th, tfoot th { background:#5C443A;
color:#FFFFFF;
padding:3px 10px 3px 10px;
text-align:left;
text-transform:uppercase;
}
tbody td a { color:#;
text-decoration:none;
}
tbody td a:visited { color:gray;
text-decoration:line-through;
}
tbody td a:hover { text-decoration:underline;
}
tbody th a { color:#;
font-weight:normal;
text-decoration:none;
}
tbody th a:hover { color:#;
}
tbody td+td+td+td a
{
background-position:left center;
background-repeat:no-repeat;
color:#03476F;
padding-left:15px;
}
tbody td+td+td+td a:visited
{
background-position:left center;
background-repeat:no-repeat;
}
tbody th, tbody td { text-align:left;
vertical-align:top;
}
tfoot td { background:#5C443A;
color:#FFFFFF;
padding-top:3px;
}
.odd { background:#fff;
}
tbody tr:hover { background:#99BCBF;
border:1px solid #03476F;
color:#;
}</style>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="" cellspacing="">
<thead>
<tr class="odd">
<th style="width:40px"> 编号</th>
<th style="width:40px">
性别</th>
<th style="width:40px">
姓名</th>
<th style="width:40px">
名族</th>
<th style="width:40px">
日期</th>
<th style="width:40px">
其他</th>
<th style="width:40px">
</th>
<th style="width:40px">
</th>
<th style="width:40px">
</th>
</tr>
</thead> <% int Count=party.Count(); for (int i = ; i < Count; i++)
{
if (i % == )
{
%> <tr class="odd">
<td><%=party[i].Jmsfzh%></td>
<td><% =party[i].Xm %></td>
<td><% =party[i].Xb %></td>
<td><% =party[i].Mz %></td>
<td><% =party[i].Csrq %></td>
<td><% =party[i].Szdzb %></td>
<td>增加</td>
<td>修改</td>
<td>删除</td> </tr> <%}
else
{
%> <tr>
<td><%=party[i].Jmsfzh%></td>
<td><% =party[i].Xm %></td>
<td><% =party[i].Xb %></td>
<td><% =party[i].Mz %></td>
<td><% =party[i].Csrq %></td>
<td><% =party[i].Szdzb %></td>
<td>增加</td>
<td>修改</td>
<td>删除</td> </tr> <%
} } %>
</table> <%-- <asp:GridView ID="grv" runat="server">
</asp:GridView>--%>
</div>
</form>
</body>
</html>
循环遍历泛型集合List绑定到table的更多相关文章
- 迭代器、foreach循环、泛型集合
集合的迭代 语法:Iterator<Object> it=集合.iterator(); while(it.hasNext()){ Object obj=it.next(); } is.ha ...
- C# 遍历泛型集合
/// <summary> /// 遍历泛型 /// </summary> /// <typeparam name="T"></typep ...
- JSP页面通过c:forEach标签循环遍历List集合
c:forEach>标签有如下属性: 属性 描述 是否必要 默认值items 要被循环的信息 否 无begin 开始的元素(0=第一个元素,1=第二个元素) 否 0end 最后一个元素(0=第一 ...
- Java:集合for高级循环遍历
增强for循环: 格式:for(变量数据类型 要遍历的变量 :元素所在数组(集合)名称) 也即 for(Type element: array或collection) 使用foreach遍历集合: 只 ...
- for循环和foreach循环遍历集合的效率比较
先上代码 package com.test; import java.util.ArrayList; import java.util.LinkedList; import java.util.Lis ...
- 遍历List集合,删除符合条件的元素
List集合的遍历有三种方式:增强for循环,普通for循环,Iterator迭代器遍历 如果只是对集合进行遍历,以上三种循环都可正常遍历: (1)增强For循环遍历List集合 List<St ...
- 将java类的泛型集合转换成json对象
一般用extjs开发传输都是用json比较多,这个将来大家也许会用到... ConvertJsonUtils.java package com.sunweb.util.jsonfactory; imp ...
- 编写高质量代码改善C#程序的157个建议[动态数组、循环遍历、对象集合初始化]
前言 软件开发过程中,不可避免会用到集合,C#中的集合表现为数组和若干集合类.不管是数组还是集合类,它们都有各自的优缺点.如何使用好集合是我们在开发过程中必须掌握的技巧.不要小看这些技巧,一旦在开 ...
- 18_集合框架_第18天_集合、Iterator迭代器、增强for循环 、泛型_讲义
今日内容介绍 1.集合 2.Iterator迭代器 3.增强for循环 4.泛型 01集合使用的回顾 *A:集合使用的回顾 *a.ArrayList集合存储5个int类型元素 public stati ...
随机推荐
- mac os 下打开FTP服务器
mac下一般用smb服务来进行远程文件访问,但要用FTP的话,高版本的mac os默认关掉了,可以用如下命令打开: sudo -s launchctl load -w /System/Library/ ...
- web前端打印总结
资料: http://blog.5ibc.net/p/39927.html 正文: 简单的说就是映入两个css文件 <link/> <link/> 每个css文件都有一个属性是 ...
- 解决win10装不了wifi驱动
右击,选择更新程序驱动软件 ok 好了
- Swift - 让程序挂起后,能在后台继续运行任务
1,程序的挂起和退出 由于iOS设备资源有限.当用户点击了home键,或者另一个应用程序启动了.那么原先那个程序便进入后台被挂起,不是退出,只是停止执行代码,同时它的内存被锁定.当应用程序恢复时,它会 ...
- mysqli扩展库的预处理技术 mysqli stmt
//预编译演示 //1,创建mysqli对象 $mysqli=new mysqli("localhost","root",""," ...
- sql server 对象资源管理器(一)
当需要查看具体数据库的所有用户表.存储过程等创建修改等脚本的时候,可以借用视图中的对象资源管理器的详细信息里面获取. 具体操作如下图所示:
- 与你相遇好幸运,Sail.js创建.sailsrc文件
在项目根目录下创建.sailsrc文件 { "generators": { "modules": {} }, "hooks": ...
- MangoDB的C#Driver驱动简单例子
以下是本人学习C#Driver驱动简单的学习例子.GridFS的增删查操作 和 表的增删查改操作. public class MongoServerHelper { public static str ...
- Java的位运算符详解实例——与(&)、非(~)、或(|)、异或(^)
位运算符主要针对二进制,它包括了:“与”.“非”.“或”.“异或”.从表面上看似乎有点像逻辑运算符,但逻辑运算符是针对两个关系运算符来进行逻辑运算,而位运算符主要针对两个二进制数的位进行逻辑运算.下面 ...
- siblings 使用
//$(object).siblings().each(function () { // $(this).find("img").attr("class", & ...