Is it possible in HTML5 to align a table caption to the left or right of the table?

css, html

Solution

Sure like this using `text-align` with left or right:

HTML

<table>
  <caption>Awesome caption</caption>
  <tr>
    <td>Awesome data</td>
  </tr>
</table>

CSS

caption {
    text-align:right;
}

If you're looking to move the caption to the left or right side of the table, it may not be possible since the `caption-side` CSS property only has standardized top and bottom properties. The left and right properties were proposed for CSS 2, but removed from the final CSS 2.1 specification and only work in Firefox.

Problem

I know you can align captions to the left and right of the table in deprecated HTML-- is it possible to do with modern HTML? **Note- text-align merely adjusts the alignment of the text, but it's still on top of the table. I want the text to actually be to the left of the table.

Original source