我想在我的动态表中显示数据表值,我循环了一遍,但我不能成功。dtplants 是我的数据表。你能帮我用下面的代码吗?
StringBuilder builder = new StringBuilder();
builder.Append("<table class=table1>");
builder.Append("<thead>");
builder.Append("<th>Configuration</th>");
builder.Append("<th>Key Figures</th>");
for (int i = 0; i < numberofplants; i++)
{
builder.Append("<th>");
builder.Append(Convert.ToString(dtplants.Rows[i]));
builder.Append("</th>");
}
builder.Append("<thead>");
builder.Append("<table>");
Literal1.Text = builder.ToString();
}