时间:2021-07-01 10:21:17 帮助过:34人阅读
tr = new TableRow(); Label labId = new Label();labId.Text = dt.Rows[i]["Sort"].ToString();labId.ID = "lblId" + (i + 1).ToString();td = new TableCell();td.Controls.Add(labId);tr.Controls.Add(td); Label labTypeName = new Label();labTypeName.Text = dt.Rows[i]["TypeName"].ToString();labTypeName.ID = "lblTypeName" + (i + 1).ToString();labTypeName.Attributes.Add("width", "100px"); td = new TableCell();td.Controls.Add(labTypeName);tr.Controls.Add(td);
转换成div干嘛呢,那你还不如把label去掉然后再加一个div