On Aug 16, 3:56 am, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> Hey,
> I am trying to build a table dynamically, but jQuery keep erroring out on
> $('<table>').append('<caption>');  Is caption supported?
> $('<table>').append('<tbody>'); works fine.

it's not jQuery which is ignoring your request. jQuery indirectly uses
the browser's internal facilities for creating DOM trees, which means
that the browser's engine is the one denying you. According to this
site:

http://www.w3schools.com/tags/tag_caption.asp

the caption must be the first tag after TABLE, before TBODY (if any).
But after some experimentation via their "try it" link, i couldn't get
it to fail either way, but maybe konqueror is especially tollerant
(i.e., not compliant) here.

My guess is that when you create your <table> the TBODY is
automatically getting added to it (someone posted complaining about
that behaviour a few days ago), which means that your append(caption)
will fail and your append(tbody) is actually NOT working because the
tbody is already in the table when that is reached. But that's a
guess. Try inspecting the dom after you create the table, before you
append the caption/tbody.


Reply via email to