// Traverse jqgrid to make the serial number column width 45 function setwidth() { $( "table[role='grid']").each( function () { // The tables created by jqgrid have the role attribute grid $('.' + $( this ).attr("class") + ' tr:first th:first').css("width", "45"); // Make the width of the serial number column of the header 40 $('.' + $( this ).attr("class") + ' tr:first td:first').css("width", "45"); // Make the serial number column width of the table body 40 }); }