Unexpected number of TD elements Error
Unexpected number of TD elements Error
bryceray1121
Posts: 65Questions: 0Answers: 0
I'm must be blind because I can't see anything wrong with my code, but i'm getting the error below. Any ideas what might be causing this?
[quote]
DataTables warning (table id = 'members_table'): Unexpected number of TD elements. Expected 2 and got 1. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
[/quote]
HTML:
[code]
Name
Date Created
Loading data from server
Name
Date Created
[/code]
JSON Data
[code]
{
"sEcho":3,
"iTotalRecords":15,
"iTotalDisplayRecords":15,
"aaData":[
["family","2011-07-17"],
["friends","2011-07-03"],
["test","2011-07-20"],
["test10","2011-07-20"],
["test11","2011-07-20"],
["test12","2011-07-20"],
["test2","2011-07-20"],
["test3","2011-07-20"],
["test4","2011-07-20"],
["test5","2011-07-20"],
["test6","2011-07-20"],
["test7","2011-07-20"],
["test8","2011-07-20"],
["test9","2011-07-20"],
["work","2011-07-11"]
]
}
[/code]
Datatables JS
[code]
$(document).ready(function() {
if($("#groups_table").length != 0){
$('#groups_table').dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "processing/groups.php",
"fnServerData": fnDataTablesPipeline
} );
}else if($("#members_table").length != 0){
var group_id = $.getUrlVar("grp");
if(group_id){
$("#members_table").dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "processing/members.php?group_id=".group_id,
"fnServerData": fnDataTablesPipeline
} );
}else{
window.location.href = "Groups.php";
}
}else{
}
} );
[/code]
Thanks for the help. I hope my error is not too obvious because I've looked over this code many times without spotting an error.
[quote]
DataTables warning (table id = 'members_table'): Unexpected number of TD elements. Expected 2 and got 1. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
[/quote]
HTML:
[code]
Name
Date Created
Loading data from server
Name
Date Created
[/code]
JSON Data
[code]
{
"sEcho":3,
"iTotalRecords":15,
"iTotalDisplayRecords":15,
"aaData":[
["family","2011-07-17"],
["friends","2011-07-03"],
["test","2011-07-20"],
["test10","2011-07-20"],
["test11","2011-07-20"],
["test12","2011-07-20"],
["test2","2011-07-20"],
["test3","2011-07-20"],
["test4","2011-07-20"],
["test5","2011-07-20"],
["test6","2011-07-20"],
["test7","2011-07-20"],
["test8","2011-07-20"],
["test9","2011-07-20"],
["work","2011-07-11"]
]
}
[/code]
Datatables JS
[code]
$(document).ready(function() {
if($("#groups_table").length != 0){
$('#groups_table').dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "processing/groups.php",
"fnServerData": fnDataTablesPipeline
} );
}else if($("#members_table").length != 0){
var group_id = $.getUrlVar("grp");
if(group_id){
$("#members_table").dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "processing/members.php?group_id=".group_id,
"fnServerData": fnDataTablesPipeline
} );
}else{
window.location.href = "Groups.php";
}
}else{
}
} );
[/code]
Thanks for the help. I hope my error is not too obvious because I've looked over this code many times without spotting an error.
This discussion has been closed.
Replies
Allan
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Groups
Name
Date Created
Loading data from server
Name
Date Created
$(document).ready(function() {
if($("#groups_table").length != 0){
$('#groups_table').dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "json.php",
"fnServerData": fnDataTablesPipeline
} );
}else if($("#members_table").length != 0){
var group_id = $.getUrlVar("grp");
if(group_id){
$("#members_table").dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "processing/members.php?group_id=".group_id,
"fnServerData": fnDataTablesPipeline
} );
}else{
window.location.href = "Groups.php";
}
}else{
}
} );
var oCache = {
iCacheLower: -1
};
function fnSetKey( aoData, sKey, mValue )
{
for ( var i=0, iLen=aoData.length ; i