In ASP.Net (C#), HTML Table does not have 'COLUMN' attribute, what to do?
asp.net, c#
Solution
`Tables.Rows[i].Cells.Count` would give you the total number of cells in a row. Which would be like columns, but may change where cell(column) spanning is different.
Problem
Basically I was doing HTML table to CSV Export in C#, So needed count of all ROWS & COLUMNS I could get the count of Rows by Table1.Rows.Count, but cannot get the count of Columns by Table1.Columns.Count. Any Ideas how do I get the number of columns ? ``` StringBuilder sb = new StringBuilder(); for (int i = 0; i < Table1.Rows.Count; i++) { for (int k = 0; k < **Table1.Column.Count**; k++) { //adding separator sb.Append(Table1.Rows[i].Cells[k].Text + ','); } //appending new line sb.Append("\r\n"); } ```