Home >Web Front-end >CSS Tutorial >Why Does jqGrid Show a Horizontal Scrollbar in Chrome, and How Can I Fix It?
jqGrid in Chrome: Horizontal Scrollbar Issue
You may encounter a horizontal scrollbar in jqGrid despite proper sizing of columns and the grid container in Chrome. This issue arises because of a mismatch between the calculated width and the actual rendered width of the grid.
Solution
The fix involves modifying the jqGrid code to incorporate a more accurate calculation of the grid's width. This includes:
In line isSafari = $.browser.webkit || $.browser.safari ? true : false;, change it to:
isSafari = ($.browser.webkit || $.browser.safari) && parseFloat($.browser.version)<536.5 ? true : false; // Chrome < version 19
Updated Considerations
Newer versions of Chrome use different WebKit versions. For Chrome 20 or higher, use parseFloat($.browser.version)<536.11 instead of parseFloat($.browser.version)<536.5.
The above is the detailed content of Why Does jqGrid Show a Horizontal Scrollbar in Chrome, and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!