How often we need all extra tags?
How often we need all extra tags?
bow
Posts: 9Questions: 1Answers: 0
I have a simple question: may be in some cases we don't need anything except a basic "table-tr-th-td" structure? Pure tables are native, automatically adjust to any width and don't waste the power of javascript engine
I appreciate the rich settings but probably we can disable gerenerating .dt-scroll-head, colgroups and many extra tags somehow?
This question has an accepted answers - jump to answer
Answers
Disable the scrolling options (
scrollX
/scrollY
) and it won't split the table, as shown in most of the examples.The
colgroup
is useful to help with alignment between pages of data, so they columns don't jump around. I don't see that it does any harm to have that particular element?Allan
Thanks for the response, I'll try to fix my elusive .dt-scroll-head later, it's not an urgent case. Currently just hiding it via display:none
Still I can't get the idea of dynamically calculating widths of the columns (which could be set in "rem" also) via pixel-widths in colgroups. To set a className for the chosen columns is quite enough in my case. But I'm also getting rid of all colgroups on each redraw so it's not the problem either. Just a notice.
It's quite interesting though to turn on both "th" and ".dt-scroll-header" and see how the second one slowly crawls after the "th" on page resizing. That's why I prefer native browser technique.
I have a complex application of dt ... struggling to control col widths via css or colDef.
Issue only when scrollX active, but that is critical to my app.
Can't replicate issue yet in simple demo, which means issue is probably me ... but the app worked fine in dt1.13.7.
I know that's no help to you, but <colgroup> <col style='width: Xpx'> just not following instructions I use in css or colDef.
And <colgroup> level/layer was not in dt1.13. It's new to dt2.0, which bow points out.
I can manually alter values in console to make table right, but that's just a tease.
c
Without a test case showing the issue, there isn't a whole lot of help I can offer I'm afraid. Please use JSFiddle, https://live.datatables.net or similar to create an example showing the issue so I can look into it.
Allan
Yes, indeed. I know.
And the wonderful thing about presenting the test case is it forces you to take the time to demo the issue in a simple way ... and usually, in process of doing that, you find the error of your ways.
Like I did, once again.
When I took the time to do a back-to-back comparison of dt1.13 and dt2.0 with a simplified test case, I learned several things, including the culprit in the width issue I was having ... I had not set the autowidth to false in my new dt2.0 code.
Please ignore my comments regarding <colgroup> above.
And, thank you for all you do.
c
Thank you. And great to hear you got it working!
Allan