Putting your script tags at the end of the body is best in terms of rendering time. IE and other browsers block rendering until the script src is loaded and evaluated. Since it's at the bottom before the body end tag, everything else above is rendered.
I don't think you'll find yourself within a <table> if you're right before the end </body> tag. And again, since all elements have been parsed/created/rendered by the browser it's accessible via document.getElement (or $).
