function dynamicColumns( tableData , tableColumns ){

	if(tableData.nodeName!='TABLE'){ alert('defined table containing data is not a table node'); return false }
	if(tableColumns.nodeName!='TABLE'){ alert('defined table containing columns is not a table node'); return false }
	if(!tableData.rows[0]){ return false }
	if(!tableColumns.rows[0]){ return false }
	if(tableData.rows[0].cells.length != tableColumns.rows[0].cells.length){
		alert('The # of cells in table containing data('+tableData.rows[0].cells.length+')\n does not match\nThe # of cells in table containing columns('+tableColumns.rows[0].cells.length+')');
	}
	
	this.rowData=tableData.rows[0];
	this.rowColumns=tableColumns.rows[0];
	this.totalRows=tableData.rows.length;
	this.totalColumns=this.rowData.cells.length;
	this.tableData=tableData;
	this.tableColumns=tableColumns;


	/* Building floating width holder */
		var newRow=this.tableData.insertRow(this.totalRows);
		//newRow.style.visibility='';
		++this.totalRows;
		for(var i=this.totalColumns-1; i >= 0; --i){
			var newCellContent=document.createElement('DIV');
			newCellContent.style.whiteSpace='nowrap';
			newCellContent.style.overflowY='hidden';
			newCellContent.style.height='1px';
			newCellContent.style.lineHeight='1px';
			newCellContent.style.visibility='hidden';

			newCellContent.innerHTML=this.rowColumns.cells[i].innerHTML;
			newCellContent.style.textAlign='center';
			newCellContent.style.margin=0;
			newCellContent.style.padding=this.rowColumns.cells[i].style.padding;
			newCellContent.style.paddingTop=0;
			newCellContent.style.paddingBottom=0;
			newCellContent.style.borderTop=0;
			newCellContent.style.borderBottom=0;
							
			var newCell=newRow.insertCell(0);
			newCell.style.paddingTop=0;
			newCell.style.paddingBottom=0;
			newCell.style.height='1px';
			newCell.className=this.rowColumns.cells[i].className;
			newCell.appendChild(newCellContent);

			var newContent=document.createElement('DIV');
			newContent.innerHTML=this.rowColumns.cells[i].innerHTML;
			newContent.style.whiteSpace='nowrap';
			this.rowColumns.cells[i].innerHTML='';
			this.rowColumns.cells[i].style.whiteSpace='nowrap';
			this.rowColumns.cells[i].appendChild(newContent);
		}
	/* Building floating width holder */
	this.calculatePosition();
}

dynamicColumns.prototype.calculatePosition = function(){
	this.rowColumns.style.padding=this.rowData.style.padding;
	this.rowColumns.style.margin=this.rowData.style.margin;
	if(this.tableData.border&&this.tableData.border!=''){
		this.tableColumns.border=this.tableData.border;
	}
	if(this.tableData.cellPadding&&this.tableData.cellPadding!=''){
		this.tableColumns.cellPadding=this.tableData.cellPadding;
	}
	if(this.tableData.cellSpacing&&this.tableData.cellSpacing!=''){
		this.tableColumns.cellSpacing=this.tableData.cellSpacing;
	}



	for(var i=0; i< this.totalColumns; ++i){
		this.tableColumns.rows[0].cells[i].style.padding=this.tableData.rows[this.totalRows-1].cells[i].style.padding;

		this.tableColumns.rows[0].cells[i].style.margin=this.tableData.rows[this.totalRows-1].cells[i].style.margin;
		if(this.tableData.rows[this.totalRows-1].cells[i].offsetWidth > 18){
			//this.tableColumns.rows[0].cells[i].style.width=width=this.tableData.rows[this.totalRows-1].cells[i].offsetWidth-18;
			this.tableColumns.rows[0].cells[i].getElementsByTagName('DIV')[0].style.width=(this.tableData.rows[this.totalRows-1].cells[i].offsetWidth-18)+'px';
		}
	}



}