Skip to content

Instantly share code, notes, and snippets.

@richcollins
Created August 23, 2008 06:45
Show Gist options
  • Save richcollins/6899 to your computer and use it in GitHub Desktop.
Save richcollins/6899 to your computer and use it in GitHub Desktop.
renderContainer: function()
{
var container = this.container();
container.html("");
var table = $("<table>");
table.attr("cellpadding", 0);
table.attr("cellspacing", 0);
jQuery.each(this._visibleProducts.partition(this.productsPerRow()), function(i, productRow){
var tr = $("tr");
jQuery.each(productRow, function(j, product){
var td = $("td");
td.attr("align", "center");
td.css("width", this._productSideLength);
td.css("height", this._productSideLength);
product.htmlElement().appendTo(td);
td.appendTo(tr);
});
tr.appendTo(table);
});
table.appendTo(container);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment