function showRowId(o){
   var currentRowIndex=o.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex;
   alert(currentRowIndex);
}
var $=function(id){
   if(id && typeof id=="string"){
      return document.getElementById(id);
   }
}
         <table id="A" border=1>
            <tr>
                <td>1</td> 
            </tr>
            <tr>
                <td >2</td>
            </tr>
            <tr>
                <td >
                    <table id="B">
                        <tr>
                            <td>3</td>
                        </tr>
                        <tr>
                            <td>
                                <input id="btnTest" type="button" value="确定1" onclick="showRowId(this)">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>我放肆地说一句:楼主你那个HTML代码真的是乱!