A warning keeps popping up that I am having a hard time debugging

A warning keeps popping up that I am having a hard time debugging

DmainEventDmainEvent Posts: 5Questions: 0Answers: 0
edited July 2011 in General
LOG: DataTables warning (table id = 'table1'): Unexpected number of TD elements. Expected 70 and got 35. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.

That actually isn't the warning, but it is the error that I find when I run Fiddler to help me debug my aplication.
Why am I getting this? I have two tables, they both perform almost exactly the same way, but one table gives me this error and the other does not? I am dumbfounded. I have a format. for both of them...
Both my tables get there data dynamically. In other words the scripts that creates my page has a loop in it that creates the . Neither one has an extra or . I have no idea why this is happening... If any of you can provide any help at all I would appreciate it.

[quote]

[/quote]

Replies

  • GregPGregP Posts: 500Questions: 10Answers: 0
    Be tricky to troubleshoot without a live link to test against. So much to inspect-- net traffic, headers, and the DOM itself. I can't help wondering if in fact some part of your loop is going around twice and you just aren't catching it.

    The error itself will only appear with a mismatch between number of cells and amount of data being returned, so either the amount of data is wrong or the table is wrong.

    In the dynamic code, is it possible that it is creating the first table (correctly), and then when it passes around to create the second table it is ALSO adding more TR/TD to the first table at the same time? Assuming both tables are otherwise identical, this would mean 70 cells in the first one and 35 in the next one.

    Do the tables have the same ID? Indeed, on ANY level are there duplicate IDs? Remember, there can only be one unique ID per page.

    Greg
  • DmainEventDmainEvent Posts: 5Questions: 0Answers: 0
    Those are all things I haven't thought of yet. Well, I have different tables on different pages with the same ID. Are you telling me site wide the id's have to be unique? I don't think that would matter though. It appears as though the table I am working with is doubling, and the other table seems fine.
  • DmainEventDmainEvent Posts: 5Questions: 0Answers: 0
    edited August 2011
    @GregP could you please elaborate. I am still experiencing that problem with very little positive results. But first let me be more specific. The tables are similar, not the same, They are formed using the same methodolgy of looping through an XML string and putting the values into the columns from there. The two tables are on two completely different aspx files and really don't interact with each other in anyway, except that the columns will have links to specific tables
    IE ActionLink("Second Table", "Action", "Controller").... <-This would link to the next table... But this table is the one having problems...




    Name


    Population ID


    Description


    isActive


    Population Type




    That is my table structure...
    Thanks.
    D
  • allanallan Posts: 63,310Questions: 1Answers: 10,433 Site admin
    If you are getting the error you mention you are using DataTables 1.7 - and 1.7 doesn't pickup TD elements in the THEAD (it more or less just ignores them). I'd suggest either changing them to TH elements or using DataTables 1.8.

    Allan
  • DmainEventDmainEvent Posts: 5Questions: 0Answers: 0
    edited August 2011
    That is what I am not getting. I have a similar setup on another page, and the warning doesn't pop up?




    Edit
    First Name
    Last Name
    DateOfBirth
    Phone
    HostpitalFinNumber
    AdminDate
    MRNType
    MRN
    PatientRoomPhone
    DischargeDateTime
    DischargeDisposition
    DischargeTo
    DischargeAdvocateCall
    Payor
    HomeHealthCareAccepted
    SafeLandingAccepted
    PCPName
    PCPPhone
    SpecialistName
    SpecialistPhone
    PCPAppointmentDateTime
    PCPAppointmentLocation
    SpecialistAppointmentDateTime
    SpecialistAppointmentLocation
    CompletedPathway
    CompletedPathwayReason
    Comment



    <!--Logic for table rows and columns goes in here. -->

    Pretty sure I have DataTables 1.8 as well. There isn't any version information on the script file, so its hard to tell. I could try and track down the download. Infact, that is what I will do.

    UPDATE: It is indeed DataTables 1.8...
This discussion has been closed.