public void PopulateTeamTable(List<ContestTeam> teams, Color[] backColors, Color[] textColors) { int colorIndex = 0; int textIndex = 0; int idIndex = 0; foreach (ContestTeam team in teams) { TeamTable.Rows.Add(MakeRowForTable(team.Name, backColors[colorIndex], textColors[textIndex])); colorIndex++; if (colorIndex == backColors.Length) { colorIndex = 0; } textIndex++; if (textIndex == textColors.Length) { textIndex = 0; } idIndex++; } }