Jqgrid serial number column width adjustment

    // 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 
        });
    }

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325008913&siteId=291194637