Ecco un esempio di codice che crea un THEAD TBODY e TFooter.
si può sostanzialmente sempre utilizzare l'oggetto TableRow basta resettare la proprietà TableSection.
Table table = new System.Web.UI.WebControls.Table();
TableRow tableRow;
TableCell tableCell;
tableRow = new TableRow();
tableRow.TableSection = TableRowSection.TableHeader;
tableCell = new TableCell();
tableCell.Text = "HEADER";
tableRow.Cells.Add(tableCell);
table.Rows.Add(tableRow);
tableRow = new TableRow();
tableRow.TableSection = TableRowSection.TableBody;
tableCell = new TableCell();
tableCell.Text = "BODY";
tableRow.Cells.Add(tableCell);
table.Rows.Add(tableRow);
tableRow = new TableRow();
tableRow.TableSection = TableRowSection.TableFooter;
tableCell = new TableCell();
tableCell.Text = "FOOTER";
tableRow.Cells.Add(tableCell);
table.Rows.Add(tableRow);
plhTest.Controls.Add(table);
Anche se vorrei suggerire la costruzione della tabella in HTML diretto e aggiungendo alla pagina.
fonte
2009-08-26 18:50:52
In qualche modo l'ho letto come "thread" e non ha assolutamente senso. Scusa per l'interruzione. –
Lo stesso! (15 caratteri fastidiosi per occupare spazio) – Jagd