|
Table bordersThe border of a table can be changed with the border="". This is usually used for the size of the border, you can change it to whichever size you want with 0 as none. The default value is usually 1px. You can add the px in the end but you don't have to.
<table border="1">
You can also change the color of the border by using bordercolor="". You can use the color name or the hex code. We will now change the bordercolor to blue as an example:
<table border="1" bordercolor="blue">
There are spaces between the cells and to get rid of the spaces, you can change the cellspacing="" to "0". Here's an example:
<table borer="1" bordercolor="blue" cellspacing="0">
If you just want a border around the table and not borders around every cell, then you will need to use nested tables. This means that you make one table with the border and then another table in that table with a border="0".
<table borer="1" bordercolor="blue" cellspacing="0">
<tr> <td> <table borer="0">
TEXT
</tr>
<tr>
If you only want certain sides to have a border, then you can use the CSS code for doing it. You can also add color and the style of the border within it. The styles include : dotted, dashed, solid, double, groove, ridge, inset, and outset.
<table style="border-left: 1px dotted #000000; border-right: 1px dotted #000000;
border-top: 1px dotted #000000; border-bottom: 1px dotted #000000;">
You don't have to have borders on all sides, you can choose which sides you want a border on and also, you can change the size, type, and color to whatever you want too. |