循环遍历泛型集合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 ...
随机推荐
- ArtDialog简单使用示例
<html><head><meta http-equiv="Content-Type" content="text/html; charse ...
- WIN7 64位系统下,右下角的声音和电源图标不见的解决办法
近日,电脑突然出现任务栏右下角的声音和电源图标消失不见的问题,重启仍旧没有修复,后来找到了解决办法 解决办法: 1.Ctrl+Shift+Esc键调出windows资源管理器. 2.找到进程中的exp ...
- iOS应用架构谈(二):View层的组织和调用方案(上)
OS客户端应用架构看似简单,但实际上要考虑的事情不少.本文作者将以系列文章的形式来回答iOS应用架构中的种种问题,本文是其中的第二篇,主要讲View层的组织和调用方案.上篇主要讲View层的代码结构. ...
- Java中length,length(),size()区别
length属性:用于获取数组长度. eg: int ar[] = new int{1,2,3} /** * 数组用length属性取得长度 */ int lenAr = ar.length;//此处 ...
- linux文件描述符open file descriptors与open files的区别
一个文件被打开,也可能没有文件描述符,比如current working diretories,memory mapped files and executable text files ;losf可 ...
- yum install 安装 下载好的rpm包 会并依赖包一起安装 zoom电话会议的安装
[root@ok-T Downloads]# rpm -ivh zoom_x86_64.rpm error: Failed dependencies: libxcb-image.so.()(64bit ...
- SQLServer子查询
in谓词子查询 select * from dbo.Worker where did in (select dID from DepartMent) 比较运算子查询 select * from Wor ...
- Delphi之DLL知识学习3---为什么要使用DLL
使用DLL有若干理由,其中有一些前面提到过的.大体说来,使用动态链接库可以共享代码.系统资源,可以隐藏实现的代码或底层的系统例程.设计自定义控件 一.共享代码.资源和数据 前面已经提到,共享代码是创建 ...
- Pyqt 时时CPU使用情况
借鉴代码来自:https://github.com/hgoldfish/quickpanel 实现代码: # -*- coding:utf-8 -*- from __future__ import p ...
- 正则表达式在JS中的应用
JavaScript表单验证email,判断一个输入量是否为邮箱email,通过正则表达式实现.//检查email邮箱function isEmail(str){ var reg = /^ ...