--- Columns-1.9.x.py	2011-09-30 11:38:46.605559472 -0500
+++ Columns-variable.py	2011-09-30 11:43:50.731067569 -0500
@@ -13,7 +13,7 @@
     columns.
 
     Usage:
-        <<Columns(columnCount, [start|end])>>
+        <<Columns(columnCount, [start|end], [width%])>>
 
         columnCount    2-10 total number of columns (used primarily to calculate column width)
 
@@ -21,7 +21,9 @@
         
         end            pass "end" as the second argument to define the last column
 
-    Examples:
+        width%         columns can be done with variable widths
+
+    Example 1:
 
         <<Columns(3, start)>>
                 This text is in the left column.
@@ -31,6 +33,14 @@
                 This text is in the right column.
         <<Columns(3, end)>>
 
+    Example 2:
+        <<Columns(3, start, 60)>>
+        This is a wide column
+        <<Columns(3, "", 5)>>
+          
+        <<Columns(3, "", 30)>> 
+        this is a narrow column with column 2 giving some spacing
+        <<Columns(3, end)>>
 
     Demo. Try pasting the above examples into a MoinMoin sandbox page.
 
@@ -56,25 +66,25 @@
 COLUMN_TEMPLATE = """
 <!-- output generated by the Columns macro Version -->
 <style>
-div.column_%(columnCount)s {
+div.column_%(columnWidth)s {
     float: left;
     width: %(columnWidth)s%%;
-    margin-left: %(marginWidth)s%%;
+    margin-right: %(marginWidth)s%%;
 }
 </style>
-<div class="column_%(columnCount)s">
+<div class="column_%(columnWidth)s">
 """
 
 def macro_Columns(macro, columnCount=required_arg(rangeStrings),
-        startOrEnd=("", "start", "end")):
+        startOrEnd=("", "start", "end"), columnWidth=0):
     tags = []
     if startOrEnd != "start":
         tags.append("\n</div><!--end column -->\n")
     if startOrEnd != "end":
-        columnWidth = int(100 / int(columnCount)) - MARGIN_WIDTH
+        if columnWidth is 0:
+            columnWidth = int(100 / int(columnCount)) - MARGIN_WIDTH
         tags.append(COLUMN_TEMPLATE % {
             "columnWidth": columnWidth,
-            "columnCount": columnCount,
             "marginWidth": MARGIN_WIDTH
             })
     if startOrEnd == "end":
@@ -85,6 +95,6 @@
         result = tags
     return "".join(result)
 
-#Facilititates quick testing on the command line        
+#Facilititates quick testing on the command line
 if __name__ == "__main__":
     print macro_Columns(None, *sys.argv[1:])
