Table with two columns and the header row grouped

Table with two columns and the header row grouped

lusabolusabo Posts: 18Questions: 0Answers: 0
edited April 2013 in General
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?

Replies

  • lusabolusabo Posts: 18Questions: 0Answers: 0
    edited April 2013
    I used something like this:

    [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!
This discussion has been closed.