My first column won't change width
My first column won't change width
Here's my table code:
[code]
$(document).ready(function() {
$('#gs_list').dataTable({
"sPaginationType": "full_numbers"
});
} );
[/code]
My problem is that I'm using the first column as an ID when displaying records. However, that ID column only needs to be, say, 25 pixels wide. Thing is, DataTables seems to force that column to be way wider than it needs to be. Always.
I've tried defining column widths in the code above, but they all change EXCEPT for the first column, which remains very wide.
I've even tried adding an inline style to the first tag, but no change. :-(
Am I missing something here?
[code]
$(document).ready(function() {
$('#gs_list').dataTable({
"sPaginationType": "full_numbers"
});
} );
[/code]
My problem is that I'm using the first column as an ID when displaying records. However, that ID column only needs to be, say, 25 pixels wide. Thing is, DataTables seems to force that column to be way wider than it needs to be. Always.
I've tried defining column widths in the code above, but they all change EXCEPT for the first column, which remains very wide.
I've even tried adding an inline style to the first tag, but no change. :-(
Am I missing something here?
This discussion has been closed.
Replies
Thanks,
Allan
[code]
DteTitleStatusClientDesigneraeType
05-06-2011
Marys gs
open
Client one
dirk
julie
web
05-06-2011
TEst Print GS FC blah
inprod
client two
jason
georgia
print
05-06-2011
TEst Print GS Dir SPot
open
client two
jason
georgia
print
05-06-2011
Test Print GS bill Gray
open
client two
jason
georgia
print
05-06-2011
Test Print GS bill
open
client two
jason
georgia
print
DteTitleStatusClientDesigneraeType
[/code]
You say that it is the first column which is causing problems. You want it to be only 25px wide - however the content in it will take up significantly more than 25px "05-06-2011" for example is about 65px, then add whatever padding your table cells might have... :-)
Allan
As for the HTML I posted, I did remove the ID column before I posted it, but that doesn't affect its behavior. I can't adjust the first column, no matter what is contained in it.
I've just released 1.8 beta 2 in which I've made a number of tweaks to how the column width is calculated. It might be worth giving that a go. Another option that springs to mind is to set td { overflow: hidden } in your CSS so any content that is taking up more space than is avaibke is hidden.
Are you able to put a cut down version of your table showing the problem in JS fiddle or on a public site?
Thanks,
Allan