By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,786 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,786 IT Pros & Developers. It's quick & easy.

what's the deal with span tag and tables tags?

P: n/a
Does anyone know what is the way IE treats span tags(<span>) and table
tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if
it placed with other elements that are in a table? Can the span tag
itself contain table tags within it?

I have some scripting code and when I wrap the span in table elements
it does not find the html within the span. Here is an example....
<tr><td colspan="4" align="left"><span id="201294_38604_1">[some html
here including tds and trs]</span></td></tr>

var span = document.getElementById(spanId);
alert("the value inside span is " + span.innerHTML); // this is blank

And if I do not wrap the span in table tags like so....

<span id="201294_38604_1">[some html here including tds and trs]</span>

It finds the html in the span. But when I clear the contents of the
html and later try to put some other html in, I do not see the html on
the screen.

Any help would be appericated.

Jul 24 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
developer wrote:
Does anyone know what is the way IE treats span tags(<span>) and table
tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if
it placed with other elements that are in a table? Can the span tag
itself contain table tags within it?


SPAN is inline so cannot contain block elements like TABLE, TR, TD, etc.
Jul 24 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.