I can't see why you would want to generate one <table> immediately inside another <table>.
I'm still surprised that it works. When you write this
<xsl:for-each select="run">
<xsl:apply-templates />
</xsl:for-each>
you are applying templates to the children of the <run> element, not to the <run> element itself. This means your template rule for match="run" will not be invoked.
It would be more usual to replace the above with
<xsl:apply-templates select="run"/>
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference