A dead simple library for laying out objects in pure JS It makes no use of any browser APIs. This library is intended for use in HTML5 canvas UIs and in non-browser based JavaScript applications.
TablePacker | A dead simple library for laying out objects in pure JS It makes no use of any browser APIs. |
Functions | |
TablePacker | Create a new TablePacker. |
add | Adds a new item. |
row | Move to a new line. |
setBounds | Resize the table. |
each | Calls the passed method for each item in the table. |
layout | Set the positions of all the objects in the table. |
Cell | Contains items in the table. |
Functions | |
left | Set this cell alignment to left. |
right | Set this cell alignment to right. |
margin | Sets all the margins to m, or if you specify a side, set only that side. |
getMargin | Get the margin on some side. |
Create a new TablePacker.
function TablePacker( x, y, w, h )
Adds a new item.
TablePacker.prototype.add = function ( item )
Move to a new line.
TablePacker.prototype.row = function ()
Resize the table.
TablePacker.prototype.setBounds = function ( x, y, w, h )
Calls the passed method for each item in the table.
TablePacker.prototype.each = function ( f )
Set the positions of all the objects in the table.
TablePacker.prototype.layout = function ()
Set this cell alignment to left.
Cell.prototype.left = function ()
Set this cell alignment to right.
Cell.prototype.right = function ()
Sets all the margins to m, or if you specify a side, set only that side.
Cell.prototype.margin = function ( m, side )
Get the margin on some side.
Cell.prototype.getMargin = function ( side )