Each time you call document.write("something")
it will over write the previous content by "something" . As pointed by Quentin either do this:
var div = document.getElementById('ausgabe');
div.innerHTML="Your entire table related code here";
(No need of div.innerHTML=div.innerHTML+....
if you don't want previous content of that div).
Or you can do this(If you want to append a new div):
var dNew = document.createElement('div');
dNew.innerHTML="yolur table related content here"
document.getElementById('your outer div id here').appendChild(dNew);