That code is invalid. A table (as many other elements) can only be closed with the according closing tag, that is
</table>. But putting attributes in an opening tag has no relevance for the status of the element.
Elements without attributes:
The same elements with attributes:
There are elements that, simply spoken, don’t have a closing tag by nature, such as
<input>. When HTML (version 4) was reformulated as application of XML (i. e. XHTML) such single elements needed to be closed, too (i. e. technically it would have been
<img></img>), and there is a shortcut writing which is to put the closing slash right in the opening tag (
So, if you were writing XHTML you could close a table by writing
<table/> (or, with attributes:
<table style="…"/>) but that would mean you couldn’t put anything inside as the code you wrote as example would translate to:
which obviously is invalid.
So, that said: Unless you are writing XHTML (either XHTML 4 or 5) you don’t need these closing slashes for single-tag elements at all.