Magical, incompatible Firefox display style value for table rows
I was writing some javascript to show/hide table rows based on user input (filtering to match search terms), and saw some really weird behavior. Now, of course, the first problem is that I was writing JS code, which I pretty well suck at. But, this seemed simple enough.
Whenever I’d hide a row, and then make it visible again, the header row would get confused, and all of the unhidden rows’ columns would be squeezed under the first header column. Weird, since the DOM hadn’t changed, and they had equal numbers of columns, etc., as always. After a bunch of head scratching a searching, I finally found this short article which talks about exactly this issue, and apparently it’s specifically a Firefox oddity.
The net/net is that Firefox has another CSS ‘display’ value besides just hidden/inline/block… they have a very special one called “table-row” which makes this work properly. Whodathunkit. But, it works great now, using the try/catch strategy outlined in the link above.