3*4表格
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<%
SanRenE.BLL.FileType bfileType = new SanRenE.BLL.FileType();
SanRenE.Model.FileTypes mfileType = new SanRenE.Model.FileTypes();
DataSet ds = bfileType.GetList(12, string.Empty, " ID DESC");
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
StringBuilder shtml = new StringBuilder();
shtml.Append("<tr>");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
shtml.Append("<td align=/"center/" bgcolor=/"EFFBFE/">·");
shtml.Append("<a target=/"_blank/" title=/"" + ds.Tables[0].Rows[i]["FileType"].ToString() + "/" href=/"file_more.aspx?typeID=" + ds.Tables[0].Rows[i]["ID"].ToString() + "/">");
string typeName = string.Empty;
if (ds.Tables[0].Rows[i]["FileType"].ToString().Length > 4)
{
typeName = ds.Tables[0].Rows[i]["FileType"].ToString().Substring(0, 4);
}
else
{
typeName = ds.Tables[0].Rows[i]["FileType"].ToString();
}
shtml.Append(typeName + "</a></td>");
if (i==3) { shtml.Append("</tr><tr>"); continue; }
if (i == 7) { shtml.Append("</tr><tr>"); continue; }
if (i == ds.Tables[0].Rows.Count-1) { shtml.Append("</tr>"); break; }
}
Response.Write(shtml.ToString());
}
%>
</table>