CSS captionside Property (original) (raw)

CSS caption-side Property

Last Updated : 22 May, 2026

The caption-side property in CSS is used to specify the position of a table caption. It determines whether the caption appears at the top or bottom of the table.

**Syntax:

caption-side: top | bottom | block-start | block-end | inline-start | inline-end | initial | inherit;

**Properties:

**Example: Here, we are using caption-side:top; property.

HTML `

caption-side property
<style>
    .geeks {
        caption-side: top;
    }
</style>

GeeksForGeeks

caption-side: top:

Table 4.1 Student Details
Student Name Enroll_no. Address
Hritik Bhatnagar 234 Delhi
Govind madan 235 kolkata
Suraj Roy 236 Mumbai
Dhruv Mishra 237 Dehadun

`

**Example: Here, we are using caption-side:bottom; property.

HTML `

caption-side property
<style>
    .geeks {
        caption-side: bottom;
    }
</style>

GeeksForGeeks

caption-side: bottom:

Table 4.1 Student Details
Student Name Enroll_no. Address
Hritik Bhatnagar 234 Delhi
Govind madan 235 kolkata
Suraj Roy 236 Mumbai
Dhruv Mishra 237 Dehadun

`

**Example: Here, we are using caption-side: initial; property.

HTML `

GeeksForGeeks

    <h2>caption-side:initial:</h2>
    <table class="geeks" border="1">
        <caption>Table 4.1 Student Details</caption>
        <tr>
            <th>Student Name</th>
            <th>Enroll_no.</th>
            <th>Address</th>
        </tr>
        <tr>
            <td>Hritik Bhatnagar</td>
            <td>234</td>
            <td>Delhi</td>
        </tr>
        <tr>
            <td>Govind madan</td>
            <td>235</td>
            <td>kolkata</td>
        </tr>
        <tr>
            <td>Suraj Roy</td>
            <td>236</td>
            <td>Mumbai</td>
        </tr>
        <tr>
            <td> Dhruv Mishra</td>
            <td>237</td>
            <td>Dehadun</td>
        </tr>
    </table>
</center>

`