I have what seems to be a simple question: I have a table that I am making as an accessible friendly element, including using the <caption> tag for the table title. This is all fine, but my element titles are styled into a ribbon which has the following structure:
<div class="ribbon"><h2></h2></div>
I have read that the caption for the table must come directly after opening the table tag, so my question is: can I wrap my caption in a div and it still be interpreted as a valid caption for a table like so?
<div class="ribbon"><caption>Title Here</caption></div>
No, it won’t. That HTML is invalid.
From the HTML 5 specification: