diff --git a/src/jquery.columnizer.js b/src/jquery.columnizer.js index 585ce00..d3de6d5 100644 --- a/src/jquery.columnizer.js +++ b/src/jquery.columnizer.js @@ -41,6 +41,9 @@ // text nodes. smaller numbers will result in higher accuracy // column widths, but will take slightly longer accuracy : false, + // false to round down column widths (for compatibility) + // true to conserve all decimals in the column widths + precise : false, // don't automatically layout columns, only use manual columnbreak manualBreaks : false, // previx for all the CSS classes used by this plugin @@ -65,7 +68,18 @@ } if(options.debug) { // assert is off by default this.debug=options.debug; - } + } + if(!options.setWidth) { + if (options.precise) { + options.setWidth = function (numCols) { + return 100 / numCols; + }; + } else { + options.setWidth = function (numCols) { + return Math.floor(100 / numCols); + }; + } + } /** * appending a text node to a