caption-side

  • Revision slug: CSS/caption-side
  • Revision title: caption-side
  • Revision id: 293277
  • 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.

  • {{ Xref_cssinitial() }}: top
  • Applies to: {{ HTMLElement("caption") }} elements
  • {{ Xref_cssinherited() }}: yes
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

caption-side: side     or 
caption-side: inherit

where:

side
Is 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
CSS 2.1 {{ 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>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}:</dfn> <code>top</code></li>
  <li><dfn>Applies to:</dfn> {{ HTMLElement("caption") }} elements</li>
  <li><dfn>{{ Xref_cssinherited() }}:</dfn> yes</li>
  <li><dfn>Media:</dfn> {{ Xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}:</dfn> as specified</li>
</ul>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="eval syntaxbox">
caption-side: <em>side</em>     <em>or</em> 
caption-side: inherit
</pre>
<p>where:</p>
<dl>
  <dt>
    <em>side</em></dt>
  <dd>
    Is a keyword representing the side of the table on which the caption box is to be placed. It may have the following values:
    <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><a class="external" href="http://www.w3.org/TR/CSS21/tables.html#caption-position" title="http://www.w3.org/TR/CSS21/tables.html#caption-position">CSS 2.1</a></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