Datatables seems to be adding an extra column

Datatables seems to be adding an extra column

AliSalamaAliSalama Posts: 2Questions: 0Answers: 0
edited March 2012 in General
Hi,

Have been using datatables for a while and really impressed with it! It's fantastic to work with. However, I have now come across an issue that I can't seem to fix, and I've read around and can't find a fix for this.

I am getting an error message that says
DataTables warning (table id = 'event_search'): Requested unknown parameter '4' from the data source for row 0

Strangely if I add this to the initialisation it works but datatables adds a to the top of my table and therefore the columns are out of line.
[code]"aoColumns": [{ "bVisible": false }, null, null, null],[/code]

The strange thing is my html markup is as so:
[code]


Venue
Date
StartTime
EndTime




abc Venue
Thu Mar 1
16:00
17:00

[/code]

Which datatables translates to:
[code]


Date

StartTime
EndTime

[/code]


As you can see there is a blank in there, were there shouldn't be, which of course messes up my table.

Any idea why this may be? Any help is greatly appreciated.

Cheers!

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Your HTML is invalid :-)

    [code]
    Date
    [/code]

    YOu need to close the th element, not open a new one!

    Allan
  • AliSalamaAliSalama Posts: 2Questions: 0Answers: 0
    That is a rookie error! I've spent hours trying to fix this and it's so obvious!

    Thank you.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Easy mistake - I've learned what to look for with this kind of error over the years. Thanks for providing all of the details in your first post :-)

    Allan
This discussion has been closed.