Buatlah tag HTML seperti berikut :
<div class="divTable"> <div class="divTableRow"> <div class="divTableCellhd">Judul 1</div> <div class="divTableCellhd">Judul 2</div> <div class="divTableCellhd">Judul 3</div> <div class="divTableCellhd">Judul 4</div> </div> <div class="divTableRow"> <div class="divTableCell">Isi baris 1 kolom 1</div> <div class="divTableCell">Isi baris 1 kolom 2</div> <div class="divTableCell">Isi baris 1 kolom 3</div> <div class="divTableCell">Isi baris 1 kolom 4</div> </div> <div class="divTableRow"> <div class="divTableCell">Isi baris 2 kolom 1</div> <div class="divTableCell">Isi baris 2 kolom 2</div> <div class="divTableCell">Isi baris 2 kolom 3</div> <div class="divTableCell">Isi baris 2 kolom 4</a> </div> </div> <div class="divTableRow"> <div class="divTableCell">Isi baris 3 kolom 1</div> <div class="divTableCell">Isi baris 3 kolom 2</div> <div class="divTableCell">Isi baris 3 kolom 3</div> <div class="divTableCell">Isi baris 3 kolom 4</div> </div> </div>
Selanjutnya buat style CSS nya,
.divTable { width: 100%; display: table; -webkit-box-shadow: 1px 1px 1px 1px #888888; box-shadow: 1px 1px 1px 1px #888888; } .divTableRow { width: 100%; height: 100%; display: table-row; } .divTableCell { padding:5px; width: 25%; height: 100%; display: table-cell; border: 1px solid #808080; } .divTableCellhd { background-color: #4a6b82; color: #fff; padding:5px; width: 25%; height: 100%; display: table-cell; border: 1px solid #808080; } .divTable .divTableRow:nth-child(odd) { background-color: #aad4ff; } .divTable .divTableRow:hover { background-color: #FBEDBB; }
Untuk demonya bisa di buka disini
Semoga bermanfaat..
0 Komentar