Is there a way to dynamically apply CSS classes to ASP.NET CheckBoxlist HTML table elements programmatically?
For instance, I would like the "table", "tr", and "td" tags in the output below (as seen in the browser View Source) to include CSS styles.
<table id="CheckBoxList1" class="myCss1 myCss1row myCss1col myCss1table__checkbox--row">
<tr>
<td><input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" >value="Item1" /><label for="CheckBoxList1_0">MyItem1</label></td>
</tr><tr>
<td><input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" >value="Item2" /><label for="CheckBoxList1_1">MyItem2</label></td>
</tr><tr>
<td><input id="CheckBoxList1_2" type="checkbox" name="CheckBoxList1$2" >value="Item3" /><label for="CheckBoxList1_2">MyItem3</label></td>
</tr><tr>
<td><input id="CheckBoxList1_3" type="checkbox" name="CheckBoxList1$3" >value="Item4" /><label for="CheckBoxList1_3">MyItem4</label></td>
</tr>
-=========== Desired Output in Browser View Source =================
<table id="CheckBoxList1" class="myCss1 myCss1row myCss1col myCss1table__checkbox--row">
<tr class="myCss1row">
<td class="myCss1col"><input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" value="Item1" /><label for="CheckBoxList1_0">BitBucket</label></td>
</tr><tr class="myCss1row">
<td class="myCss1col"><input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" value="Item2" /><label for="CheckBoxList1_1">Confluence</label></td>
</tr><tr class="myCss1row">
<td class="myCss1col"><input id="CheckBoxList1_2" type="checkbox" name="CheckBoxList1$2" value="Item3" /><label for="CheckBoxList1_2">FECRU</label></td>
</tr><tr class="myCss1row">
<td class="myCss1col"><input id="CheckBoxList1_3" type="checkbox" name="CheckBoxList1$3" value="Item4" /><label for="CheckBoxList1_3">JIRA</label></td>
</tr>
--======================================================================
Here is a snippet of the code:
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="ToolName" DataValueField="ToolName" CssClass="myCss1 myCss1row myCss1col myCss1table__checkbox--row"">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" SelectCommand="SELECT [ToolName], [ToolCost], [PDate], [ToolURL], [ToolLink], [ToolUrl] FROM [ToolInfo]"></asp:SqlDataSource>
Thank you for your anticipated response!