Yes, an extension object is essentially just another div on a webpage (which is a QlikView sheet in this case) so you can definitely change it.
You could do this a variety of ways, but my suggestion would be to create a div (or table or whatever you're doing) inside the extension that holds all the rows. Then add all the data and even though the extension div itself has a set height, the table you created inside will have its own height. Now, just get the height of the table or div you created and set the extension's div to this same height.
So, say you've created a table with an id of "superTable". Once all the rows have been added to superTable AND you've added that table and its HTML to the extension, get the height of this table into a variable:
var tableHeight = document.getElementById("superTable").offsetHeight;
Then set the height of the extension itself to this height:
this.Element.style.height = tableHeight + "px";