日期:2014-05-17 浏览次数:20386 次
HtmlTable table1 = new HtmlTable();
table1.Border = 1;
HtmlTableRow row;
HtmlTableCell cell;
for (int i = 0; i < dt.Rows.Count; i++) {
row = new HtmlTableRow();
cell = new HtmlTableCell();
cell.InnerHtml = dt.Rows[i][0].ToString();
row.Cells.Add(cell);
cell = new HtmlTableCell();
cell.InnerHtml = dt.Rows[i][1].ToString();
row.Cells.Add(cell);
cell = new HtmlTableCell();
cell.InnerHtml = dt.Rows[i][2].ToString();
row.Cells.Add(cell);
cell = new HtmlTableCell();
cell.InnerHtml = dt.Rows[i][3].ToString();
row.Cells.Add(cell);
cell = new HtmlTableCell();
cell.InnerHtml = dt.Rows[i][4].ToString();
row.Cells.Add(cell);
table1.Rows.Add(row);
}
Page.Controls.Add(table1);
<%@ page language="C#" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html> <head> <script type="text/javascript"> function contactlist(){ var table = document.getElementById("conta