This topic is locked

Freeze header row - column formatting

6/24/2011 1:19:08 PM
PHPRunner General questions
J
Jsnop author

Does anyone know exactly how the on page formatting happen? I am trying to create a frozen header row by using jquery to clone the existing header row, but my cloned row does not have the same column widths as the original. It looks like the header row somehow adjusts the width parameters based on the actual data that loaded to the table on the screen. Â Can anyone please help me to understand how I can adjust the width values of my cloned row's columns like the original header row does?

C
cgphp 6/24/2011

Jsnop,
header cells are adjusted based on their content. The following is a sample to capture width cells with jquery:

$("#your table id or table name").find("thead th").each(function(){

$(this).clone().appendTo("tr where to append this clone").css("width",$(this).width());

});


Hope this can help you.