[closed]Unexpected number of TD elements. Expected 25 and got 24
[closed]Unexpected number of TD elements. Expected 25 and got 24
CasperTDk
Posts: 5Questions: 0Answers: 0
DataTables warning (table id = 'GridView1'): Unexpected number of TD elements. Expected 25 and got 24. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
My javascript
[code]var oTable = $('#GridView1').dataTable({
"aoColumns": [
{ "bSortable": false },
null, null, null, null
],
"aaSorting": [[0, 'asc']]
});
new FixedHeader(oTable);
[/code]
the table:
[code]
IDAdresseBeskrivelseBemærkningAnsvarligV
My javascript
[code]var oTable = $('#GridView1').dataTable({
"aoColumns": [
{ "bSortable": false },
null, null, null, null
],
"aaSorting": [[0, 'asc']]
});
new FixedHeader(oTable);
[/code]
the table:
[code]
IDAdresseBeskrivelseBemærkningAnsvarligV
This discussion has been closed.
Replies
The table is written in ASP.net. It is a GridView control.
Can the issue not be fixed in javascript?
For your GridView you need to add a PreRender function like this in your code behind file:
[code]private void GridView_PreRender(object sender, EventArgs e)
{
GridView.UseAccessibleHeader = true;
GridView.HeaderRow.TableSection = TableRowSection.TableHeader;
}[/code]
and wire it to your Page_Load function:
[code]this.GridView.PreRender += new EventHandler(GridView_PreRender);[/code]
This will give the table the required and tags.
Cassandra