Home > Article > Web Front-end > How to convert this Label to Div?_html/css_WEB-ITnose
There is a Table that is dynamically generated in the background of the page
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);
Why convert it into a div? Then you might as well remove the label and add a div