Browse Source

Add halign column option.

zhixin 11 years ago
parent
commit
189828be7d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/bootstrap-table.js

+ 5 - 0
src/bootstrap-table.js

@@ -149,6 +149,7 @@
         title: undefined,
         title: undefined,
         'class': undefined,
         'class': undefined,
         align: undefined, // left, right, center
         align: undefined, // left, right, center
+        halign: undefined, // left, right, center
         valign: undefined, // top, middle, bottom
         valign: undefined, // top, middle, bottom
         width: undefined,
         width: undefined,
         sortable: false,
         sortable: false,
@@ -279,6 +280,10 @@
             that.header.events.push(column.events);
             that.header.events.push(column.events);
             that.header.sorters.push(column.sorter);
             that.header.sorters.push(column.sorter);
 
 
+            if (column.halign) {
+                style = sprintf('text-align: %s; ', column.halign) +
+                    sprintf('vertical-align: %s; ', column.valign);
+            }
             style += sprintf('width: %spx; ', column.checkbox || column.radio ? 36 : column.width);
             style += sprintf('width: %spx; ', column.checkbox || column.radio ? 36 : column.width);
             style += that.options.sortable && column.sortable ? 'cursor: pointer; ' : '';
             style += that.options.sortable && column.sortable ? 'cursor: pointer; ' : '';