protected void Page_Load(object sender, EventArgs e)
{
UserDataBLL udb = new UserDataBLL();
Table tb = new Table();
IList<UserData> alistData = udb.findAll();//获取表中所有的数据
int icount = alistData.Count;
int totalCount = 5;//显示几行几列
for (int i = 0; i < totalCount; i++)
{
TableRow tr = new TableRow();
for (int j = 0; j < totalCount; j++)//无论i是等于几,j总是从0开始!呵呵!
{
TableCell tc = new TableCell();
Label lbli = new Label();
int index = i * totalCount + j;//0*5+0 0*5+1 0*5+2 0*5+3 0*5+4
if (index >= icount)
Table TableRow TableCell生成几行几列的表格
最新推荐文章于 2022-12-22 21:51:04 发布