www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 captionSide Property
caption-side Attribute | captionSide Property
New for Windows Internet Explorer 8
Note: This documentation is preliminary and is subject to change.

Sets or retrieves where the caption of a table is located.

Syntax

HTML { caption-side : sLocation }
Scripting[ sLocation = ] object.style.captionSide [ = v ]

Possible Values

sLocationString that specifies or receives the placement of the caption.
top The caption is placed above the table.
bottom The caption is placed below the table.

The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has no default value. The Cascading Style Sheets (CSS) attribute is inherited.

Remarks

This style attribute can be applied to any element with a display style of table-caption.

This property requires Internet Explorer to be in IE8 mode rendering.

Examples

The following example constructs a table with standard HTML elements. The style rule places the caption above the table.

<meta http-equiv="X-UA-Compatible" content="IE=8" />
				
<style type="text/css">
caption {
    caption-side:top;
}
</style>

<table><tr><td>A simple table.</td></tr>
<caption>Table caption.</caption>
</table> 

This example uses CSS to construct a table using display attributes. This caption is also placed above its associated table.

<meta http-equiv="X-UA-Compatible" content="IE=8" />
				
<style type="text/css">
.table {
    display:table;
    border:1px #eee outset;
    border-spacing:2px;
}
.cell {
    display:table-cell;
    border:1px solid black;
}
.caption {
    display:table-caption;
    caption-side:top;
}
</style>

<div class="table">
<span class="cell">Table content.</span>
<em class="caption">A caption.</em>
</div>

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 2 Revision 1 (CSS2.1) World Wide Web link.

Applies To

currentStyle, runtimeStyle, style, CAPTION

See Also

display
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG