Judul 1
Judul 2
Judul 3
Judul 4
Isi baris 1 kolom 1
Isi baris 1 kolom 2
Isi baris 1 kolom 3
Isi baris 1 kolom 4
Isi baris 2 kolom 1
Isi baris 2 kolom 2
Isi baris 2 kolom 3
Isi baris 2 kolom 4
Isi baris 3 kolom 1
Isi baris 3 kolom 2
Isi baris 3 kolom 3
Isi baris 3 kolom 4
Buatlah tag HTML seperti berikut :
<br />
<div class="divTable">
<div class="divTableRow">
<div class="divTableCellhd" style="text-align: center;">
Judul 1</div>
<div class="divTableCellhd" style="text-align: center;">
Judul 2</div>
<div class="divTableCellhd" style="text-align: center;">
Judul 3</div>
<div class="divTableCellhd" style="text-align: center;">
Judul 4</div>
</div>
<div class="divTableRow" style="text-align: center;">
<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" style="text-align: center;">
<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</div>
</div>
<div class="divTableRow" style="text-align: center;">
<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,
<style>
.divTable {
width: 100%;
display: table;
-webkit-box-shadow: 0;
box-shadow: 0;
}
.divTableRow {
width: 100%;
height: 100%;
display: table-row;
}
.divTableCell {
padding:5px;
width: 25%;
height: 100%;
display: table-cell;
border: 0;
}
.divTableCellhd {
background-color: #4a6b82;
color: #fff;
padding:5px;
width: 25%;
height: 100%;
display: table-cell;
border: 0;
}
.divTable .divTableRow:nth-child(odd) {
background-color: #aad4ff;
}
.divTable .divTableRow:hover {
background-color: #FBEDBB;
}
</style>
Posting Komentar