HTML Table Attributes




You can specify a table in your HTML coding by using the table tag - <table>, </table>. Rows and columns can be specified using tr>, </tr> (row) and <td>,</td> for column.

 

You can mention certain specific attributes for the table. Such attributes can be the table width, height, border and background color.

 

Here is how you can specify such attributes:

 

<table bgcolor="white" height="100" width="100" cellspacing="1" cellpadding="0">

</table>

 

Now, if you wish to specify attributes for a row inside the table you need to just mention the respective tag and then the attribute alongside it.

 

<tr bgcolor="black" height="100" width="100">

</tr>

 

Same goes for the row

 

<td bgcolor="black" height="100" width="100">

</td>

 

In addition to this, your table can have a table title and an id, but these will not appear, in the page display.

 

Here is how you can mention the id and the title for your table:

 

<table title="First HTML Table" id="First Table">

</table>

 

Here is how all of this looks when you put all of this together:

 

<table title="First table" height="250" width="400"  border="0" bgcolor="black" cellspacing="1" cellpadding="0">

<tr height="50"><td bgcolor="white">

<td>You can put the first image here</td>

</tr>

<tr height="25"><td bgcolor="black">

<tr>

<td>Second image!</td>

<td>Third Image!</td>

<td>Fourth Image!</td>

</tr>

<tr height="10">

<td bgcolor="black" Last  Image>

<tr>

</table>