non capisco che modo stai usando, ci sono molte cose poco chiare.
Tabella con tre righe e tre colonne
codice:Dim righe As Integer = 3 Dim celle As Integer = 3 Dim tabellaHTML As New Table() tabellaHTML.BorderWidth = 1 tabellaHTML.CellPadding = 3 tabellaHTML.CellSpacing = 3 For j As Integer = 1 To righe Dim riga As New TableRow() riga.BorderWidth = 1 For i As Integer = 1 To celle Dim cella As New TableCell() cella.BorderWidth = 1 Dim tb As New TextBox() tb.BackColor = Drawing.Color.Azure tb.Text = "Riga " + j.ToString() + " - Cella " + i.ToString() cella.Controls.Add(tb) riga.Cells.Add(cella) Next tabellaHTML.Rows.Add(riga) Next ph1.Controls.Add(tabellaHTML)
"ph1" è un PlaceHolder posizionato nell'HTML, altrimenti la tabella non si vede.
codice:<form runat="server" id="form1"> ..... <asp:PlaceHolder ID="ph1" runat="server"></asp:PlaceHolder> </form>


Rispondi quotando