asp.net 打印02-guoyz_1【http://blog.csdn.net/guoyz_1 】

aspx<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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> <mce:style type="text/css" media="print,screen"><!-- th { font-family: Arial; color: black; background-color: lightgrey; } thead { display: table-header-group; } tbody { display: table-row-group; } --></mce:style><style type="text/css" media="print,screen" mce_bogus="1"> th { font-family: Arial; color: black; background-color: lightgrey; } thead { display: table-header-group; } tbody { display: table-row-group; } </style> </head> <body style="text-align: center;" mce_style="text-align: center;"> <form id="form1" runat="server"> <div style="width: 100%; text-align: center;"> <table> <tr> <th> 就第一页有 </th> <th> First Name </th> <th> Last Name </th> </tr> <tr> <th> 就第一页有 </th> <th> First Name </th> <th> Last Name </th> </tr> </table> <table border="1" cellpadding="2" cellspacing="0"> <thead> <tr> <th> ID </th> <th> First Name </th> <th> Last Name </th> </tr> </thead> <tbody> <cfoutput query = "query_name" group = "query_column" > <cfloop from="1" to="50" index="11" > <tbody id="ttable" runat="server"> </tbody> </cfloop> </cfoutput> </tbody> </table> </div> </form> </body> </html>

 

cs

public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { for (int i = 0; i < 200; i++) { ttable.InnerHtml += "<tr><td>#"+i.ToString()+"#</td><td>First Name #i#</td><td>Last Name #i#</td></tr>"; } } } }

 

 

你可能感兴趣的:(html,server,XHTML,table,query,asp.net)