Главная / Программирование на ASP.NET / В результате выполнения какого фрагмента кода в браузере будет выведена таблица, содержащая 3 строки и 5 столбцов?

В результате выполнения какого фрагмента кода в браузере будет выведена таблица, содержащая 3 строки и 5 столбцов?

вопрос

Правильный ответ:

System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table(); table.BorderWidth = 1; for (int row = 1; row <= 3; row++) { TableRow tr = new TableRow(); table.Rows.Add(tr); for (int col = 1; col <= 5; col++) { TableCell tc = new TableCell(); tr.Cells.Add(tc); tc.Text = string.Format("{{{0},{1}}}",row + 1, col + 1); tc.BorderWidth = 1; if (row % 2 == 0) tc.BackColor = System.Drawing.Color.Moccasin; else tc.BackColor = System.Drawing.Color.PowderBlue; } }
System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table(); form1.Controls.Add(table); table.BorderWidth = 1; for (int row = 0; row < 3; row++) { TableRow tr = new TableRow(); table.Rows.Add(tr); for (int col = 0; col < 5; col++) { TableCell tc = new TableCell(); tr.Cells.Add(tc); tc.Text = string.Format("{{{0},{1}}}",row + 1, col + 1); tc.BorderWidth = 1; if (row % 2 == 0) tc.BackColor = System.Drawing.Color.Moccasin; else tc.BackColor = System.Drawing.Color.PowderBlue; } }
System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table(); form1.Controls.Add(table); table.BorderWidth = 1; for (int row = 1; row < 3; row++) { TableRow tr = new TableRow(); table.Rows.Add(tr); for (int col = 1; col < 5; col++) { TableCell tc = new TableCell(); tr.Cells.Add(tc); tc.Text = string.Format("{{{0},{1}}}",row + 1, col + 1); tc.BorderWidth = 1; if (row % 2 == 0) tc.BackColor = System.Drawing.Color.Moccasin; else tc.BackColor = System.Drawing.Color.PowderBlue; } }
Сложность вопроса
72
Сложность курса: Программирование на ASP.NET
50
Оценить вопрос
Очень сложно
Сложно
Средне
Легко
Очень легко
Комментарии:
Аноним
Очень сложные тесты
27 ноя 2020
Аноним
Экзамен сдан и ладушки.
23 мар 2017
Оставить комментарий
Другие ответы на вопросы из темы интернет-технологии интуит.