w3schools    w3Schools
Search :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
HTML Reference
HTML by Alphabet
HTML by Function
HTML Attributes
HTML Events
HTML Colornames
HTML Character Sets
HTML ASCII
HTML ISO-8859-1
HTML Symbols
HTML URL Encode
HTML Lang Codes
HTTP Messages

HTML Tags
<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<b>
<base>
<basefont>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<dd>
<del>
<dfn>
<dir>
<div>
<dl>
<dt>
<em>
<fieldset>
<font>
<form>
<frame>
<frameset>
<head>
<h1> - <h6>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<map>
<menu>
<meta>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<p>
<param>
<pre>
<q>
<s>
<samp>
<script>
<select>
<small>
<span>
<strike>
<strong>
<style>
<sub>
<sup>
<table>
<tbody>
<td>
<textarea>
<tfoot>
<th>
<thead>
<title>
<tr>
<tt>
<u>
<ul>
<var>

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

Browse Tutorials
 

HTML caption align Attribute


HTML caption Tag Reference HTML <caption> tag

Definition and Usage

The align attribute specifies horizontal and vertical position of the caption element relative to the table element.


Compatibility Notes

The align attribute of the caption element was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.

Use CSS instead.

CSS syntax: <caption style="caption-side:right">

In our CSS tutorial you can find more details about the caption-side property.


Syntax

<caption align="alignment">

Syntax Example

<caption align="right">

Attribute Values

Value Description
left The caption text will be shown on the left side of the table.
right The caption text will be shown on the right side of the table.
top The caption text will be shown on the top side of the table.
bottom The caption text will be shown on the bottom side of the table.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The attribute is deprecated, and only Firefox shows this attribute correctly. Use CSS instead.


Example

Source Output
<table border="1">
<caption align="right">
This is a caption</caption>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
This is a caption
Cell 1 Cell 2


Try-It-Yourself Demos

caption align attribute example
Set the caption text position with the caption align attribute.

In CSS: caption position example
Set the caption text alignment with CSS.


HTML caption Tag Reference HTML <caption> tag