Introducing ReUI:Open-source UI components and apps built with React, Next.js and Tailwind CSS
Browse ReUI

Datatables unwanted colgroup markup added


Hi, I am using metronic_html_v8.2.7_demo7 Datatables.
$('#categories_list').DataTable({responsive: false})
Even if use responsive:true or responsive false its automatically adds
<colgroup></colgroup> markup to table. that shouldn't added automatically
i want to use my own <colgroup> markup in html

Kindly guide me if there is any configuration


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

This looks like the Datatable.net plugin's default behavior and is probably a bug. Can you please report this issue via https://datatables.net/forums/

We will double-check for any case on our end as well.

Regards,
Sean



Hi,
I found answer about this on datatables.net by author

"Yes, I'm afraid that is correct. DataTables will now inject its own colgroup which is used for sizing. Sorry, but it was the best way to get the sizing to work and merging an existing tag was proving to be quite complex."

This was added in after v2.0 that's very strange behavior.
columnDefs:[] is solution for this but control column width from html is very easy as compare to add columnDefs:[] is Datatables configuration.



Hi,

Thanks for sharing this info. This is how datatable 2.0 works now.

Regards,
Sean


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(