diff --git a/demo.html b/demo.html
index 0ecb607..0f5b019 100644
--- a/demo.html
+++ b/demo.html
@@ -217,6 +217,7 @@
Table 2
// table 1
var opt1 = {
colTypes: ["alpha", "alpha", "number", "number"],
+ colNames: ["shortname", "longname", "price1", "price2"],
pager: {
rowsCount: 15,
currentPage: 3
diff --git a/dynamic_table.js b/dynamic_table.js
index 5e15ff3..a12519a 100755
--- a/dynamic_table.js
+++ b/dynamic_table.js
@@ -92,10 +92,15 @@ function DynamicTable(obj, options){
colTools.className = "tool-" + (i + 1);
if (this.opt.colTypes[i] != "none"){
+ // add options name
+ var name = document.createElement('div');
+ name.innerHTML = options.colNames[i];
+ name = name.firstChild;
+
// input filter
var filter = document.createElement("input");
filter.type = "text";
- filter.style.float = "left";
+ filter.style.float = "right";
filter.className = "dynamic-table-filter";
DynamicTableEvent.observe(filter, "keypress", this._filterRows);
this.filters.push(filter);
@@ -106,6 +111,7 @@ function DynamicTable(obj, options){
toolBtn.className = "dynamic-table-downarrow";
DynamicTableEvent.observe(toolBtn, "click", this._toolbarClick);
+ colTools.appendChild(name);
colTools.appendChild(filter);
colTools.appendChild(toolBtn);