CSS table border
Home - Tutorials - CSS tutorials
In this article I will demonstrate how you can use effectively CSS table borders to style your html tables.
Tutorial info:
| Name: | CSS table border |
| Total steps: | 3 |
| Category: | CSS tutorials |
| Date: | 2007-11-09 |
| Level: | Beginner |
| Product: | See complete product |
| Viewed: | 21197 |
Bookmark CSS table border
Step 1 - Introduction
CSS table border
To start with this tutorial first create a simple html table with 3 columns and 3 rows. It is quite simple and with it we can check to let's say original condition. So the following HTML code:
Code:
</table>
results a 3x3 table like this:
| Th-1 | Th-2 | Th-3 |
|---|---|---|
| cell-11 | cell-12 | cell-13 |
| cell-21 | cell-22 | cell-23 |
As you can see this is not really what you usually want if you need to display your data in a nicely formatted table.
Of course you can change the look of the table directly in the table code to make the table a bit bigger and add a visible border to it like this way:
Code:
<table width="300" border="1"> </table>
Which code results the following output:
| Th-1 | Th-2 | Th-3 |
|---|---|---|
| cell-11 | cell-12 | cell-13 |
| cell-21 | cell-22 | cell-23 |
However using CSS we can do it much better without editing our table code.
Next Step of CSS table border
Tags: CSS table border, css table, css border, table border, css, table, border
| CSS table border - Table of contents |
|---|
| Step 1 - Introduction |
| Step 2 - Border style |
| Step 3 - CSS border collapse |