string str = "<table style='100%;' border=1><tr>";
int j = 0;
for (int i = 1; i <= 13; i++)
{
j = i;
if (i % 3 == 0)
{
str += "<td>" + i.ToString() + "</td></tr><tr>";
}
else
{
str += "<td>" + i.ToString() + "</td>";
}
}
if (j / 3 != 0)
{
for (int i = 0; i < 3 - (j % 3); i++)
{
str += "<td>" + i.ToString() + "</td>";
}
}
str += "</tr></table>";
Response.Write(str);