Sedangkan file tampilannya akan kita buat seperti kode dibawah ini :
/* Tabel Properti */ #mytable { padding: 0; margin: 0; } #mytable td { border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; background: #efefefe; color: #0066ff; padding: 2px; } #mytable td.genap { border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; color: #0066ff; background: #eeee22; padding: 2px; } #mytable td.alt { background:#0099ff; color: #fff; border-top: 1px solid #ccc; text-align: center; font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; padding: 2px; } #mytable td.spec { border-left: 1px solid #ccc; border-top: 0; background: #efefefe; padding: 2px; } #mytable td.spec1 { border-left: 1px solid #ccc; border-top: 0; background: #eeee22; padding: 2px; } #mytable td.specalt { background: #0099ff; border-top: 1px solid #ccc; border-left: 1px solid #ccc; font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #fff; text-align: center; padding: 2px; }
<html> <head> <title>tabel tabel</title> <link href="table.css" rel="stylesheet" type="text/css" /> </head> <body> <table id=mytable cellspacing="0" width=48%> <tr> <td width="5px" class=specalt ><center>No</center></td> <td width="100px" class=alt ><center>Sender</center></td> <td width="100px" class=alt ><center>Received Time</center></td> <td width="200px" class=alt ><center>Message</center></td> </tr> <tr> <td width="5px" class=spec>1</td> <td>08136141xxxx</td> <td>21 Maret 2012</td> <td>Ini contoh pesan aja</td> </tr> <tr> <td width="5px" class=spec1>2</td> <td class="genap">08136141xxxx</td> <td class="genap">21 Maret 2012</td> <td class="genap">Ini contoh pesan aja</td> </tr> <tr> <td width="5px" class=spec>3</td> <td>08136141xxxx</td> <td>21 Maret 2012</td> <td>Ini contoh pesan aja</td> </tr> </body> </html>
Jika kode tersebut di jalankan, maka hasilnya akan terlihat seperti gambar di bawah ini :
Tidak ada komentar:
Posting Komentar