Table headings are defined with the <th> tag. By default, all major browsers display table headings as bold and centered. To left-align the table headings, use the CSS text-align property in the <style> element:
HTML file: | Displayed by browser: | ||||||
---|---|---|---|---|---|---|---|
<style>
table { border-spacing: 1px; width: 100%; } th { color:teal; text-align:left; } td { border: 1px solid black; padding:10px; vertical-align:top; } </style> <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Points</th> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table> |
Remember:
|