Skip to content

Instantly share code, notes, and snippets.

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 freekrai/1112478 to your computer and use it in GitHub Desktop.
Save freekrai/1112478 to your computer and use it in GitHub Desktop.
// Plugin
$.fn.iWouldLikeToAbsolutelyPositionThingsInsideOfFrickingTableCellsPlease = function() {
var $el;
return this.each(function() {
$el = $(this);
var newDiv = $("<div />", {
"class": "innerWrapper",
"css" : {
"height" : $el.height(),
"width" : "100%",
"position": "relative"
}
});
$el.wrapInner(newDiv);
});
};
// DOM Ready
$(function() {
// Usage
$("th, td").iWouldLikeToAbsolutelyPositionThingsInsideOfFrickingTableCellsPlease();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment