Table with two columns and the header row grouped
Table with two columns and the header row grouped
Hello everybody,
I have the following JSON:
[code][{id:1, description:Test1}, {id:2, description:Test2}, {id:3, description:Test3}][/code]
I want my table like this:
|---------------------------|
|My Records................ | --> Colspan 2
|---------------------------|
| img + link | Test 1......|
|---------------------------|
| img + link | Test 2......|
|---------------------------|
| img + link | Test 3......|
|---------------------------|
ps: The dots is used only to align the table.
I'm trying use aoColumnDefs, but, always appears two columns on row header.
How can I do it?
I have the following JSON:
[code][{id:1, description:Test1}, {id:2, description:Test2}, {id:3, description:Test3}][/code]
I want my table like this:
|---------------------------|
|My Records................ | --> Colspan 2
|---------------------------|
| img + link | Test 1......|
|---------------------------|
| img + link | Test 2......|
|---------------------------|
| img + link | Test 3......|
|---------------------------|
ps: The dots is used only to align the table.
I'm trying use aoColumnDefs, but, always appears two columns on row header.
How can I do it?
This discussion has been closed.
Replies
[code]
"fnHeaderCallback": function( nHead ) {
$(nHead.getElementsByTagName('th')[0]).attr("colspan","4");
for(var i = 1; i <= 3; i++){
$(nHead.getElementsByTagName('th')[1]).remove();
}
}
[/code]
It's works, but, I don't this it is the best way!