caption-side

  • Revision slug: CSS/caption-side
  • Revision title: caption-side
  • Revision id: 361259
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The caption-side CSS property positions the content of a table's {{ HTMLElement("caption") }} on the specified side.

{{cssbox("caption-side")}}

Syntax

Formal syntax: {{csssyntax("caption-side")}}
caption-side: top
caption-side: bottom
caption-side: left     /* Warning: non-standard value */
caption-side: right    /* Warning: non-standard value */
 
caption-side: inherit

Values

top bottom left right
A keyword representing the side of the table on which the caption box is to be placed. It may have the following values:
top The caption box will be above the table.
bottom The caption box will be below the table.

left {{ not_standard_inline() }}

The caption box will be on the left side of the table.

Note: this value was proposed for CSS 2, but removed from the final CSS 2.1 specification. It is non-standard.

right {{ not_standard_inline() }}

The caption box will be on the right side of the table.
Note: this value was proposed for CSS 2, but removed from the final CSS 2.1 specification. It is non-standard.
inherit
Is a keyword indicating that the caption-side value defined on the parent's element must be used.

Examples

.contentbox table-caption {
  caption-side: bottom;
}

Specifications

Specification Status Comment
{{ SpecName('CSS2.1', 'tables.html#caption-position', 'caption-side') }} {{ Spec2('CSS2.1') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox Internet Explorer Opera Safari
Basic support 1.0 1.0 8.0 4.0 1.0
left and right {{ not_standard_inline() }} {{ CompatNo() }} {{ CompatVersionUnknown() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
left and right {{ not_standard_inline() }} {{ CompatNo() }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

See also

  • The table-related CSS properties: {{ CSS_Reference:Table_Properties() }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <code>caption-side</code> <a href="/en/CSS" title="CSS">CSS</a> property positions the content of a table's {{ HTMLElement("caption") }} on the specified side.</p>
<p>{{cssbox("caption-side")}}</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("caption-side")}}
</pre>
<pre>
caption-side: top
caption-side: bottom
caption-side: left     /* Warning: non-standard value */
caption-side: right    /* Warning: non-standard value */
 
caption-side: inherit
</pre>
<h3 id="Values">Values</h3>
<dl>
  <dt>
    <code>top</code> <code>bottom</code> <code>left</code> <code>right</code></dt>
  <dd>
    A<span id="cke_bm_72C" style="display: none;">&nbsp;</span> keyword representing the side of the table on which the caption box is to be placed. It may have the following values:</dd>
  <dd>
    <table class="standard-table">
      <tbody>
        <tr>
          <td><code>top</code></td>
          <td>The caption box will be above the table.</td>
        </tr>
        <tr>
          <td><code>bottom</code></td>
          <td>The caption box will be below the table.</td>
        </tr>
        <tr>
          <td>
            <p><code>left</code> {{ not_standard_inline() }}</p>
          </td>
          <td>
            <p class="note">The caption box will be on the left side of the table.</p>
            <div class="note">
              <strong>Note:</strong> this value was proposed for CSS 2, but removed from the final CSS 2.1 specification. It is non-standard.</div>
          </td>
        </tr>
        <tr>
          <td>
            <p><code>right</code> {{ not_standard_inline() }}</p>
          </td>
          <td>The caption box will be on the right side of the table.<br />
            <div class="note">
              <strong>Note:</strong> this value was proposed for CSS 2, but removed from the final CSS 2.1 specification. It is non-standard.</div>
          </td>
        </tr>
      </tbody>
    </table>
  </dd>
  <dt>
    inherit</dt>
  <dd>
    Is a keyword indicating that the <code>caption-side</code> value defined on the parent's element must be used.</dd>
</dl>
<h2 id="Examples" name="Examples">Examples</h2>
<pre class="brush:css">
.contentbox table-caption {
  caption-side: bottom;
}
</pre>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS2.1', 'tables.html#caption-position', 'caption-side') }}</td>
      <td>{{ Spec2('CSS2.1') }}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>1.0</td>
        <td>1.0</td>
        <td>8.0</td>
        <td>4.0</td>
        <td>1.0</td>
      </tr>
      <tr>
        <td><code>left</code> and <code>right</code> {{ not_standard_inline() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE&nbsp;Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td><code>left</code> and <code>right</code> {{ not_standard_inline() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li>The table-related CSS properties: {{ CSS_Reference:Table_Properties() }}</li>
</ul>
Revert to this revision