Berikut ini adalah beberapa adalah contoh table untuk membuat tabel.
-----------------------------------------------------------------------------------
Contoh 1 :
<table style="background-color: #9932CC; font-weight: bold; font-size: 13px; text-align: center;" width="300" height="90" cellspacing="1" cellpadding="5" border="0">
<tr>
<td style="background-color: #9932CC; color: #FFFFFF" colspan="3">#9932CC</td>
</tr> <tr>
</table><td style="background-color: #6B248E; color: #EFCFFE">#6B248E</td>
<td style="background-color: #EFCFFE; color: #6B248E">#EFCFFE</td>
<td style="background-color: #DF9FFE; color: #6B248E">#DF9FFE</td>
</tr> <td style="background-color: #EFCFFE; color: #6B248E">#EFCFFE</td>
<td style="background-color: #DF9FFE; color: #6B248E">#DF9FFE</td>
hasilnya :
#9932CC | ||
#6B248E | #EFCFFE | #DF9FFE |
Source : http://www.html-color-names.com/table-background.php
Contoh 2 :
<table border=1 bgcolor=green>
<tr>
<td>
This is 1st row 1st column
</td>
<td>
This is 1st row 2nd column
</td>
</tr>
<tr>
<td>
This is 2nd row 1st column
</td>
<td background="./test.jpg">
This is 2nd row 2nd column <br><br> Nice background
</td>
</tr>
</table>
hasilnya :
This is 1st row 1st column | This is 1st row 2nd column |
This is 2nd row 1st column | This is 2nd row 2nd column Nice background |
Source : http://hscripts.com/tutorials/html/table-color.php
Contoh 3:
<table style="background-color: #9932CC; font-weight: bold; font-size: 13px; text-align: center;" border="1">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>
<tr>
<td>Ramesh Raman</td>
<td>5000</td>
</tr>
<tr>
<td>Shabbir Hussein</td>
<td>7000</td>
</tr>
</table>
Hasilnya :
Name | Salary |
---|---|
Ramesh Raman | 5000 |
Shabbir Hussein | 7000 |
Source : http://www.tutorialspoint.com/html/html_tables.htm