ssri
ssri

Reputation: 1300

Applying padding to the head of table

Is there any way i can set padding to the thead alone of a table?

Upvotes: 7

Views: 18529

Answers (2)

pooja
pooja

Reputation: 2432

<table>
    <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Savings</th>
    </tr>
    <tr>
        <td>Jhon</td>
        <td>Smith</td>
        <td>$200</td>
    </tr>
</table>

<style>
    table, td, th { border : 1px solid black; }
    th { padding : 13px; }
    td { padding : 15px; }
</style>

Upvotes: 5

Bhanu Prakash Pandey
Bhanu Prakash Pandey

Reputation: 3785

table th
{
padding:15px;
}

Upvotes: 6

Related Questions