I'm dynamically creating a table with rows of 4 different statuses. I'm using an asp:table and adding rows programmatically. Like this (generically)
What I'm going to write is a function which shows and hides rows based on their status. i.e. 4 toggle buttons: "Show/Hide Status1", "Show/Hide Status2", "Show/Hide Status3", and "Show/Hide Status4". In order to do this in Javascript I was planning on wrapping each row in a div tag, such that the output html looks something like this
Then in Javascript, depending on which button is pressed I can show or hide the divs. The problem is I'm not sure how (or if it's even possible) to wrap an asp:TableRow in a div. Can this be done, or is there another solution. Thanks, and have a great day.
Code:
TableCell tc = new TableCell();
tc.Text = "1";
TableRow tr = new TableRow();
tr.Cells.Add(tc);
tblMyTable.Rows.Add(tr);
Code:
<table>
<div id="Row1">
<tr>
<td>Item1</td>
</tr>
</div>
<div id="Row2">
<tr>
<td>Item2</td>
</tr>
</div>
<div id="Row3">
<tr>
<td>Item3</td>
</tr>
</div>
<div id="Row4">
<tr>
<td>Item4</td>
</tr>
</div>
</table>