Skip to content

Instantly share code, notes, and snippets.

@kamilogorek
Created May 8, 2013 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamilogorek/5539272 to your computer and use it in GitHub Desktop.
Save kamilogorek/5539272 to your computer and use it in GitHub Desktop.
Equal cells width within table columns
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