I'm using GridView control which generates the following HTML:
<table>
<tr><td>...</td><td>...</td></tr>
<tr><td>...</td><td>...</td></tr>
...
</table>
I want to change the HTML of last row to something like this:
<table>
<tr><td>...</td><td>...</td></tr>
<tr><td>...</td><td>...</td></tr>
...
<tr><td colspan="2"><span>...</span><span>...</span></td></tr>
</table>
I can set the colspan value of first cell but don't know how to group those 2 cells in one TD element. Can I do that using GridView control or do I have to use Repeater?
Any help would be greatly appreciated.
EDIT
I'm using the following code to solve the problem:
// get cell values
string firstValue = lastRow.Cells[0].Text;
string secondValue = lastRow.Cells[1].Text;
// remove the second cell
lastRow.Cells.RemoveAt(1);
// set column span
lastRow.Cells[0].ColumnSpan = 2;
// set text inside TD element
lastRow.Cells[0].Text = "<span>" + totalText + @"</span><span>" +
totalConsumptionText + @"</span>";