Så må du gerne poste den herinde, så andre kan have gavn af den :)
Jeg smider min løsning herinde alligevel, selvom spørgsmålet er lukket. Synd, hvis arbejdet er spildt :)
Librarieshttp://code.jquery.com/jquery-1.7.2.js
CodeDu skal selv erstatte fremhævet tekst med dine udgaver<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<title>Insert Table Row</title>
<script type="text/javascript" src="
JQuery/jquery-1.7.2.js"></script>
<style type="text/css" media="screen">
#MyTable_Template
{
display: none;
}
#MyTable td
{
padding: 2px 4px;
}
.MyTable_Header td
{
font-weight: bold;
border-bottom: 4px solid #000;
text-align: left;
}
.MyTable_Header .Name
{
width: 270px;
}
.MyTable_Header .Address
{
width: 390px;
}
.MyTable_Header .Country
{
width: 140px;
}
.MyTable_Header .Phone
{
width: 110px;
}
#MyTable_Body td
{
border-bottom: 2px dotted #000;
}
#MyTable_Body tr:last-child td
{
border-bottom: none;
}
#MyTable_Body tr.Even
{
background-color: #CCF;
}
#MyTable_Body tr.Odd
{
background-color: #CCC;
}
</style>
</head>
<body>
<table id="MyTable" cellspacing="0">
<thead>
<tr>
<td colspan="4">
<input id="MyTable_AddRow_Button" type="button" value="Add row" />
</td>
</tr>
<tr class="MyTable_Header">
<td class="Name">
Name
</td>
<td class="Address">
Address
</td>
<td class="Country">
Country / State
</td>
<td class="Phone">
Phone
</td>
</tr>
</thead>
<tbody id="MyTable_Body">
<tr id="MyTable_Template">
<td>
<input type="text" size="40" name="Name" />
</td>
<td>
<input type="text" size="60" name="Address" />
</td>
<td>
<select name="Country">
<option value="00">-- Choose --</option>
<optgroup label="Europe">
<option value="DK">Denmark</option>
<option value="DE">Germany</option>
<option value="UK">United Kingdom</option>
</optgroup>
<optgroup label="United States">
<option value="US-AL">Alabama</option>
<option value="US-NY">New York</option>
<option value="US-WA">Washington</option>
</optgroup>
</select>
</td>
<td>
<input type="text" maxlength="14" size="14" name="Phone" />
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
$("#MyTable_AddRow_Button").click(function ()
{
var template = $("#MyTable_Template").clone();
template.removeAttr("id");
template.appendTo($("#MyTable_Body"));
template.addClass(($("#MyTable_Body").children("tr").length - 1) % 2 == 0 ? "Even" : "Odd");
});
</script>
</body>
</html>