Sure, no problem. It really depends on where you're calling your function from, though. These examples should get you started, but if you need more help post some sample code or email it to me and I'll take a look at it.
This passes a reference to the table into the function. Note that written this way, it works in IE browsers only. I've generated the reference to the table a couple different ways each time, to show that there is more than one way to do it.
<script language="JavaScript">
function Foo(theTable) {
alert(theTable.id);
//you could call theTable.deleteRow() here
}
</script>
<input type="button" value="Click Me" onclick="JavaScript:Foo(document.all.someTableName)">
<table id="someTableName">
<tr id="someTableRow">
<td><input type="button" value="Click Me" onclick="JavaScript:Foo(this.parentNode.parentNode.parentNode.parentNode)">
<td><input type="button" value="Click Me" onclick="JavaScript:Foo(document.all.someTableName)">
</tr>
<tr onmouseover="JavaScript:Foo(this.parentNode.parentNode)">
<td>Hover over me</td>
</tr>
<tr onmouseover="JavaScript:Foo(document.all('someTableName'))">
<td>Hover over me, too</td>
</tr>
</table>
Personally, though, I would opt to pass the name of the table into the function, and get a reference to the table object using it. It's simpler, cleaner, easier to read, and can quite easily be made to be browser-independent. I've left the non-IE browser code out for simplicity, however.
<script language="JavaScript">
function Foo2(theTableName) {
var theTable;
if ( document.all ) {
//IE browser
theTable = document.all(theTableName);
alert(theTable.id);
} else {
//non-IE browser
//add code in here to get reference to table
theTable = "";
}
//you could then call theTable.deleteRow() here
}
</script>
<input type="button" value="Click Me" onclick="JavaScript:Foo2('someOtherTableName')">
<table id="someOtherTableName">
<tr id="someTableRow">
<td><input type="button" value="Click Me" onclick="JavaScript:Foo2('someOtherTableName')">
</tr>
<tr onmouseover="JavaScript:Foo2('someOtherTableName')">
<td>Hover over me</td>
</tr>
</table>
Clark