0

hi, how could i change the color of the cell in a table using this code??

<script language="javascript">
function addRow(tableID) 
{ 
	var table = document.getElementById(tableID); 
	var rowCount = table.rows.length;
	var row = table.insertRow(rowCount);   
	
	var cella = row.insertCell(0);
	var element1 = document.createElement("input");
	element1.type = "text";
	element1.name = "txtManufacturer[]";
	element1.size = "10";
	cella.appendChild(element1);	
}
</script>
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by codewall
0

maybe this help

<script language="javascript">
function addRow(tableID) 
{ 
	var table = document.getElementById(tableID); 
	var rowCount = table.rows.length;
	var row = table.insertRow(rowCount);   
 
	var cella = row.insertCell(0);
        cella.style.backgroundColor='#FF0000';
	var element1 = document.createElement("input");
	element1.type = "text";
	element1.name = "txtManufacturer[]";
	element1.size = "10";
	cella.appendChild(element1);	
}
</script>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.