日期:2014-05-17 浏览次数:20524 次
string[] sss = { "11111", "2222", "33333", "444444", "555555", "6666666666", "77777777", "8888888888" };
string test = "<table border='1' align='center'>";
for (int i = 0; i < sss.Length; i++)
{
//判断一行显示三列
if (i % 3 == 0)
test += "<tr>";
test += "<td>" + sss[i] + "</td>";
if (i % 3 == 2)
test += "</tr>";
}
for (int i = 0; i < 3 - sss.Length % 3; i++)
test += "<td>多出的单元格</td>";
test += "</table>";
Response.Write(test);