<html>
<head>
<script type="text/javascript">
function insCell(){
{
var x=document.getElementById('tr2').insertCell(0)
x.innerHTML="John"
}}
</script>
<style type="text/css">
tr:hover,
tr.altrow {
background: #c4e4ff;
}
</style>
</head>
<body>
<table border="1">
<tr id="tr1">
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr id="tr2">
<td>Peter</td>
<td>Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick="insCell()" value="Insert cell">
</body>
</html>