paulopmx / Flexigrid

Lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect to an xml/json based data source using Ajax to load the content.
689 stars 539 forks source link

use Chrome & Firefox thead tbody can't align #137

Open guuhub opened 10 years ago

guuhub commented 10 years ago

show the code, you will understand. "loopIndex" num is jsonObj each times

var _width = $('div:first', pth).eq(0).css('width').replace('px', '') - 1; if (loopIndex == 0) { _width += 1; } $(tdDiv).css({ textAlign: pth.align, width: $('div:first', pth)[0].style.width //width: $('div:first', pth)[0].style.width width: _width + 'px' });

guuhub commented 10 years ago

if (p.dataType == 'json') { _width + 'px' } else { $('div:first', pth)[0].style.width }