Skip to content

Instantly share code, notes, and snippets.

@chriscoyier
Created January 4, 2011 18:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save chriscoyier/765142 to your computer and use it in GitHub Desktop.
Save chriscoyier/765142 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();
});
@chriscoyier
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment