I am trying to build HTML table through DataTable as per this article Export ASP.Net Repeater Control to Excel File the codes are working fine.
But my Required output is RequiredOutPut
Dim inputData As DataTable = DBH.GetDataTable(SqlStr)
Dim Sb As StringBuilder = New StringBuilder
Dim inputColumnNames As String() = {"SrNo", "TripDate", "OrderNos", "CNDoNo", "Description", "ContainerType", "VehicalNo", "OtherChargesTxt", "TaxPercentage", "TransCharges", "OtherChargesV", "TaxAmt", "TotalAmtWithoutTax"}
' Create the data table
Sb.Append("<table cellpadding='5' cellspacing='0' style='border: 1px solid #ccc;font-size: 9pt;font-family:Arial;width:750px'>")
Sb.Append("<thead>")
Sb.Append("<tr>")
For Each columnName As String In inputColumnNames
Sb.Append("<th>" & columnName & "</th>")
Next
Sb.Append("</tr>")
Sb.Append("</thead>")
For Each row As DataRow In inputData.Rows
Sb.Append("<tr>")
For Each columnName As String In inputColumnNames
Sb.Append("<td style='width:100px;border: 1px solid #ccc'>" & row(columnName).ToString() & "</td>")
Next
Sb.Append("</tr>")
Next
Sb.Append("</table>")
PlaceHolder1.Controls.Add(New Literal() With {.Text = Sb.ToString()})
Kindly help to build required output