column header size
column header size
mbroadst
Posts: 14Questions: 0Answers: 0
Tried this out in the bugs section to no avail, hope this is the right place.
I have a problem where column headers are not being resized appropriately. The more I look at it, there doesn't seem to be a hard and fast rule for what exactly is screwing up the formatting. Attached is an image displaying what's going on. The table itself has many columns of various length, and I am using the current configuration:
[code]
oTable = $('#terminal_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sScrollX": '100%',
"sAjaxSource": "{{=URL('terminal', 'list.json')}}",
"bJQueryUI": true,
"bDeferRender": true,
"sPaginationType": "full_numbers",
"bFilter": true,
"aoColumns": [
{"mDataProp":'index', "bVisible":false},
{"mDataProp":'name', "sTitle":'Name'},
{"mDataProp":'description', "sTitle":'Description', "sWidth":'100px'},
{"mDataProp":'location', "sTitle":'Location', "sWidth":'100px'},
{"mDataProp":'ip_address', "sTitle":'IP Address'},
{"mDataProp":'last_contact', "sTitle":'Last Contact'},
{"mDataProp":'last_terminal_message', "sTitle":'Last Terminal Message', "sWidth":'100px'},
{"mDataProp":'model', "sTitle":'Model'},
{"mDataProp":'operating_system', "sTitle":'Operating System'},
{"mDataProp":'disk_image_version', "sTitle":'Disk Image Version'},
{"mDataProp":'manufacturer', "sTitle":'Manufacturer'},
{"mDataProp":'agent_version', "sTitle":'Agent Version'},
{"mDataProp":'hostname', "sTitle":'Hostname'},
{"mDataProp":'mac_address', "sTitle":'MAC Address'},
{"mDataProp":'serial', "sTitle":'Serial'},
{"mDataProp":'uuid', "sTitle":'UUID'}
]
} );
[/code]
As you can see, I'm explicitly setting the size of some of the columns because otherwise they stretch quite large, even when the whole column is empty. What I am looking for is the table headers to stretch to the right, all resized according to column content AND header length. Each header item should not be wrapped, as well as table items. Everything should fit on a single line since we have already decided to use the scroll area.
Again, no idea whats going on here so I hope someone can help.
Here is the image: http://tinypic.com/r/xg9nvp/7
Thanks,
Matt
I have a problem where column headers are not being resized appropriately. The more I look at it, there doesn't seem to be a hard and fast rule for what exactly is screwing up the formatting. Attached is an image displaying what's going on. The table itself has many columns of various length, and I am using the current configuration:
[code]
oTable = $('#terminal_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sScrollX": '100%',
"sAjaxSource": "{{=URL('terminal', 'list.json')}}",
"bJQueryUI": true,
"bDeferRender": true,
"sPaginationType": "full_numbers",
"bFilter": true,
"aoColumns": [
{"mDataProp":'index', "bVisible":false},
{"mDataProp":'name', "sTitle":'Name'},
{"mDataProp":'description', "sTitle":'Description', "sWidth":'100px'},
{"mDataProp":'location', "sTitle":'Location', "sWidth":'100px'},
{"mDataProp":'ip_address', "sTitle":'IP Address'},
{"mDataProp":'last_contact', "sTitle":'Last Contact'},
{"mDataProp":'last_terminal_message', "sTitle":'Last Terminal Message', "sWidth":'100px'},
{"mDataProp":'model', "sTitle":'Model'},
{"mDataProp":'operating_system', "sTitle":'Operating System'},
{"mDataProp":'disk_image_version', "sTitle":'Disk Image Version'},
{"mDataProp":'manufacturer', "sTitle":'Manufacturer'},
{"mDataProp":'agent_version', "sTitle":'Agent Version'},
{"mDataProp":'hostname', "sTitle":'Hostname'},
{"mDataProp":'mac_address', "sTitle":'MAC Address'},
{"mDataProp":'serial', "sTitle":'Serial'},
{"mDataProp":'uuid', "sTitle":'UUID'}
]
} );
[/code]
As you can see, I'm explicitly setting the size of some of the columns because otherwise they stretch quite large, even when the whole column is empty. What I am looking for is the table headers to stretch to the right, all resized according to column content AND header length. Each header item should not be wrapped, as well as table items. Everything should fit on a single line since we have already decided to use the scroll area.
Again, no idea whats going on here so I hope someone can help.
Here is the image: http://tinypic.com/r/xg9nvp/7
Thanks,
Matt
This discussion has been closed.
Replies