How to Format Borders For Your Tables
By admin on Jan 7, 2010 | In Free Web Design Tutorials | Send feedback »
The example you see here is a very basic webpage with one table, and the table has just a single data cell.
And as you can see one data cell means it just has one row and one column.
As you can see the table has the standard table tag, width equals 500 pixels, border width equals 1 pixel, align is in the center, background color white and there is a closed table tag right before the closed body tag. You can see there is just one table row tag and one td tag which is table data, and within the td tag are couple of paragraphs.
Now if you want to add some more powerful border effects to your table, you can do with the following way:
First you get rid of the border attribute in the initial code piece,
There are three pieces of information you add here, with space between each one: width, style and color. In your functioning code you replace these placeholders with the actual width, style and color you desire.
In this demo the width is set to 4 pixels, style is set to dashed, and the color of the border is set to blue:
That's how you can easily style an attractive looking borders with different colors and various styles for your table.
Follow up:
It's a single cell within the table, surrounded by a black border. Here is the source code for this page:
As you can see the table has the standard table tag, width equals 500 pixels, border width equals 1 pixel, align is in the center, background color white and there is a closed table tag right before the closed body tag. You can see there is just one table row tag and one td tag which is table data, and within the td tag are couple of paragraphs.
Now if you want to add some more powerful border effects to your table, you can do with the following way:
First you get rid of the border attribute in the initial code piece, border=1, and let's add some code still as part of the table tag:

style="border: 4px dashed blue" You can also set the style to dotted or solid. These are standard cascade style sheets settings, and you can google for more details. For the color attribute, you can also use the hexadecimal color code or just plain text.
No you save the edited code, go back to the browser and hit refresh. You can see how it looks:
That's how you can easily style an attractive looking borders with different colors and various styles for your table.
No feedback yet
Leave a comment
| « How To Format A Table Within Another Table | How To Add Popups That Won't Be Blocked By Your Visitors' Website » |



