Какой фрагмент кода реализует вывод следующей динамической таблицы?
(Отметьте один правильный вариант ответа.)
Варианты ответа
HtmlGenericControl header = new HtmlGenericControl();header.InnerHtml = "<h1>Матрица</h1>";this.Controls.Add(header);HtmlTable table1 = new HtmlTable();HtmlTableRow row;HtmlTableCell cell;int maxRow = 5, maxCell = 4;table1.Border = 1; table1.CellPadding = 3; table1.CellSpacing = 3;row = new HtmlTableRow();for (int i = 0; i < maxRow; i++){ for (int j = 0; j < maxCell; j++) { cell = new HtmlTableCell(); cell.InnerHtml = "(" + (i+1).ToString() + ";" + (j+1).ToString() + ")"; row.Cells.Add(cell); } table1.Rows.Add(row);}this.Controls.Add(table1);
HtmlGenericControl header = new HtmlGenericControl();header.InnerHtml = "<h1>Матрица</h1>";this.Controls.Add(header);HtmlTable table1 = new HtmlTable();HtmlTableRow row;HtmlTableCell cell;int maxRow = 5, maxCell = 4;table1.Border = 1; table1.CellPadding = 3; table1.CellSpacing = 3; for (int i = 1; i <= maxRow; i++){ row = new HtmlTableRow(); for (int j = 1; j <= maxCell; j++) { cell = new HtmlTableCell(); cell.InnerHtml = "(" + i.ToString() + ";" + j.ToString() + ")"; row.Cells.Add(cell); } table1.Rows.Add(row);}this.Controls.Add(table1);(Верный ответ)
HtmlGenericControl header = new HtmlGenericControl();header.InnerHtml = "<h1>Матрица</h1>";this.Controls.Add(header);HtmlTable table1 = new HtmlTable();HtmlTableRow row;HtmlTableCell cell;int maxRow = 5, maxCell = 4;table1.Border = 1; table1.CellPadding = 3; table1.CellSpacing = 3;for (int i = 0; i < maxRow; i++){ row = new HtmlTableRow(); cell = new HtmlTableCell(); for (int j = 0; j < maxCell; j++) { cell.InnerHtml = "(" + (i+1).ToString() + ";" + (j+1).ToString() + ")"; row.Cells.Add(cell); } table1.Rows.Add(row);}this.Controls.Add(table1);