Open M-J-Robbins opened 1 year ago
Example of the workaround
<table>
<caption><span style="color:red">Concerts</span></caption>
<tr>
<th>Date</th>
<th>Event</th>
<th>Venue</th>
</tr>
<tr>
<td>12 Feb</td>
<td>Waltz with Strauss</td>
<td>Main Hall</td>
</tr>
</table>
will become.
<span style="color:red;">Concerts</span>
<table>
<tbody><tr>
<th>Date</th>
<th>Event</th>
<th>Venue</th>
</tr>
<tr>
<td>12 Feb</td>
<td>Waltz with Strauss</td>
<td>Main Hall</td>
</tr>
</tbody></table>
When using a table with a caption such as this example from W3C
Mail.ru will remove the
<caption>
element and place the text before the<table>
This means you will not only loose the semantic meaning of the
<caption>
but also any styling on it. If you add a<div>
inside the<caption>
to try and maintain styles it will add a<tr>
and<td>
to the<table>
and place the<div>
there.So the best workaround I've found is to add a
<span>
inside the<caption>
you can apply styles there and they will remain, however you will still loose the relationship to the table.