循环遍历泛型集合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 ...
随机推荐
- Oracle数据库对象题库
一. 填空题 在用 create 语句创建基本表时,最初只是一个空的框架,用户可以使用insert命令把数据插入表中. 在基本表不需要时,可以使用 drop table 语句撤消.在一个基本表撤 ...
- java课后作业7
9.页实验 下列语句哪一个将引起编译错误?为什么?哪一个会引起运行时错误?为什么? m=d; d=m; d=(Dog)m; d=c; c=(Cat)m; 答: d=m;和d=c;引起编译错误: 原因: ...
- 25个增强iOS应用程序性能的提示和技巧--中级篇
25个增强iOS应用程序性能的提示和技巧--中级篇 标签: ios性能优化内存管理 2013-12-13 10:55 738人阅读 评论(0) 收藏 举报 分类: IPhone开发高级系列(34) ...
- [Linux] linux awk命令详解
reference : http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html 简介 awk是一个强大的文本分析工具,相对于g ...
- July 3rd, Week 28th Sunday, 2016
2016-07-03 First-hand experience is often necessary for personal growth. 亲身体验通常是成长所必须的. Although som ...
- js中我的注释规范
模块功能描述说明: /** * ------------------------------------------------------------------ * 模块描述说明 * ------ ...
- No space left on device you must specify the filesystem type--Linux重启挂在失败
在Linux中拷贝了一个文件比较大5G,直接提示:No SPace Left On Device,很明显是磁盘空间不够了,我因为是在虚拟机上面建的,直接右击虚拟机==>编辑设置 如图片1所示, ...
- Android Native jni 编程入门
在某些情况下,java编程已经不能满足我们的需要,比如一个复杂的算法处理,这时候就需要用到jni(java native interface)技术: jni 其实就是java和c/cpp之间进行通信的 ...
- 当ListView有Header时,onItemClick里的position不正确
原文:http://blog.chengbo.net/2012/03/09/onitemclick-return-wrong-position-when-listview-has-headerview ...
- 【翻译十四】java-并发之保护块儿
Guarded Blocks Threads often have to coordinate their actions. The most common coordination idiom is ...