Created
May 8, 2013 09:16
-
-
Save kamilogorek/5539272 to your computer and use it in GitHub Desktop.
Equal cells width within table columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cells = []; | |
var header = $('table').find('tr:first').find('th'); | |
var rows = $('table').find('tr').not(':first'); | |
header.each(function(i, val){ | |
cells.push($(val).width()); | |
}); | |
rows.each(function(i, val) { | |
var _this = this; | |
$.each(cells, function(i, val) { | |
$(_this).find('td').eq(i).width(val); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment