mozilla

Revision 652565 of caption-side

  • Revision slug: Web/CSS/caption-side
  • Revision title: caption-side
  • Revision id: 652565
  • Created:
  • Creator: Sebastianz
  • Is current revision? No
  • Comment Adjusted listing of values to be conform with other CSS property values descriptions

Revision Content

{{ CSSRef("CSS Tables") }}

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
Is a keyword indicating that the caption box should be positioned above the table.
bottom
Is a keyword indicating that the caption box should be positioned below the table.
left {{ not_standard_inline() }}
Is a keyword indicating that the caption box should be positioned 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() }}
Is a keyword indicating that the caption box should be positioned 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("CSS Tables") }}</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></dt>
 <dd>
  Is a keyword indicating that the caption box should be positioned above the table.</dd>
 <dt>
  <code>bottom</code></dt>
 <dd>
  Is a keyword indicating that the caption box should be positioned below the table.</dd>
 <dt>
  <code>left</code> {{ not_standard_inline() }}</dt>
 <dd>
  Is a keyword indicating that the caption box should be positioned on the left side of the table.<br />
  {{ Note("This value was proposed for CSS 2, but removed from the final CSS 2.1 specification. It is non-standard.") }}</dd>
 <dt>
  <code>right</code> {{ not_standard_inline() }}</dt>
 <dd>
  Is a keyword indicating that the caption box should be positioned on the right side of the table.<br />
  {{ Note("This value was proposed for CSS 2, but removed from the final CSS 2.1 specification. It is non-standard.") }}</dd>
 <dt>
  <code>inherit</code></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