I have an array of tables, each with a size of 6 x 6, and a placeholder. My goal is to arrange these tables in the placeholder so that they appear in rows of 6 next to each other. I am unsure about which CSS properties to apply to achieve this layout.
LiteralControl ltr = new LiteralControl();
ltr.Text = "<style type=\"text/css\" rel=\"stylesheet\">" + @".fl { float: left}</style>";
this.Page.Header.Controls.Add(ltr);
Table[,] tableArray = new Table[6,6];
for (int j = 0; j < tableArray.GetLength(0); j++)
{
bool first = true;
for (int i = 0; i < tableArray.GetLength(1); i++)
{
if (first)
{
tableArray[j, i].CssClass = "mGrid";
first = false;
}
else
{
tableArray[j, i].CssClass = "fl mGrid";
}
tableArray[j, i].Width = Unit.Percentage(100 / 6);
PlaceHolderTables.Controls.Add(tableArray[j, i]);
}
}
However, I am struggling to figure out how to start a new row after each set of 6 tables. As someone new to CSS, I find the process challenging. The initialization of the tables and the definition of 'mGrid' have already been completed elsewhere.