3
在一個html表格行中插入多個html單元格。下面的代碼將單元格添加到一行中。在一個html表格行中插入多個html單元格
HtmlTable MyTable = new HtmlTable();
HtmlTableRow row = new HtmlTableRow();
HtmlTableCell cell = new HtmlTableCell();
cell = (new HtmlTableCell
{
InnerHtml = Text + ":",
Align = "Left"
});
row.Cells.Add(cell);
cell = (new HtmlTableCell
{
InnerHtml = "Minimum" + " " + "33" + "%",
Align = "Right"
});
row.Cells.Add(cell);
cell = (new HtmlTableCell
{
InnerHtml = "Maximum" + " " + "34" + "%",
Align = "Right"
});
row.Cells.Add(cell);
MyTable.Rows.Add(selectedFeatures);
結果是這樣的: -
但我希望它是這樣的: -
嘗試創建幾行,而不是將單元格添加到同一行。 – Asalle
我必須在同一行添加單元格。 – user3106445
然後你會得到你的數據在同一行,這不是你想要的 – Asalle