Unable to export the table with 2 tbody to excel

Unable to export the table with 2 tbody to excel

harender_24harender_24 Posts: 9Questions: 3Answers: 0

I have a dynamic table with multiple tbody. I am using DataTable Library Everything is working fine but when i try to export the table in Excel, it only extract the first tbody. How can we extract all tbody content?

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @harender_24 ,

    Yep, the table should only have a single tbody - see here.

    Cheers,

    Colin

  • harender_24harender_24 Posts: 9Questions: 3Answers: 0

    Ok but what if we have multiple tbody. Can we use export all tbody content?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    You cannot use multiple tbody tags. It isn't valid HTML.

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @tangerine / @harender_24 ,

    It is valid HTML to have two <tbody> elements - see here. The issue is just that DataTables doesn't support it.

    Cheers,

    Colin

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    My apologies - thanks, Colin.

  • harender_24harender_24 Posts: 9Questions: 3Answers: 0

    Ok. Thank you Colin

  • allanallan Posts: 63,186Questions: 1Answers: 10,411 Site admin

    I had planned to use multiple tbody elements to do grouping at some point, but that wouldn't allow for RowGroup's multiple level of grouping ability. So I think its unlikely we'll ever support multiple tbody elements in a DataTable unless someone can present a good reason to do so (other than that its valid HTML).

    Allan

This discussion has been closed.