// Table creation data
/*

+---------------------------------------------------------------------------------------------+
|Table - Function
+---------------------------------------------------------------------------------------------+

	assign(container)		-> container
	row();				-> Main row
*/
function table()
{
	var container;					// main container
	var maintable;					// contain the main table database
	var curretrow					// main  current row
	var currentCol;					// The current col statement
	
	
	
	this.maintable = document.createElement("TABLE");
	
	// assign the contactin
	this.assign= function($container)
	{
		
		this.container = $container;
		$k = document.getElementById(this.container);
		
		if((typeof this.maintable.outerHTML) == "undefined")
		{
			$k.innerHTML = "";
			$k.appendChild(this.maintable);
		}
		else
		{
			$k.innerHTML = this.maintable.outerHTML;
		}
	}
	
	
	this.attribute= function($property)
	{
		for($k in $property)
		{
			// setting the property
			this.maintable.setAttribute($k,$property[$k]);
		}
	
	}
	
	//create a new row 
	this.row = function ($property)
	{
		this.currentRow = document.createElement("TR");
		
		for($k in $property)
		{
			// setting the property
			this.currentRow.setAttribute($k,$property[$k]);
		}
		this.maintable.appendChild(this.currentRow);
	}
	
	
	// creating the columns
	//create a new row 
	this.col = function ($main,$property)
	{
		this.currentCol = document.createElement("TD");
		
		for($k in $property)
		{
			// setting the property
			this.currentCol.setAttribute($k,$property[$k]);
		}
		this.currentCol.innerHTML = $main;
		this.currentRow.appendChild(this.currentCol);
	}
	
	
	
} // end of the table
