Is it possible to make certain columns narrower than the others
Is it possible to make certain columns narrower than the others
andras2
Posts: 31Questions: 12Answers: 0
Hi there,
I had a look at the column option on the website but I could not find the answer.
I would like to make certain column extra narrow such as the one for selection-checkbox (and a short for serial number).
I had a look at this;
https://datatables.net/extensions/fixedcolumns/examples/initialisation/size_fixed
but, I do not need column to be fixed.
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Answers
Using
columns.width
is used to set the column's width. Its not always that simple and there maybe other things that you need to to to make it work. PLease post a link to your page or a test case replicating the issue so we can offer suggestions.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi there,
Thank you. I tried but it did not work; My site is actually an Electron like app with Eel and Python; Here is the full source code; The upper part is about the Javascripts (including DataTable) and the bottom part is simple HTML.
There is nothing obvious in the code. I wonder if you can take the generated web page and build a test case from that?
The problem could be the size of the header or the size of the data in the columns which don't allow for making the column smaller. There could be a CSS setting overriding the column size. Maybe this thread will give some ideas. You might find other threads on the forum with helpful tips.
Kevin
Hi Kavein,
I managed to find the solution; columnDefs had been defined twice. I reorganized the code with the line below and now it works as expected;