<!DOCTYPE html>
|
<html lang="en-us">
|
<head>
|
<meta charset="UTF-8">
|
<title>relative positioning for table rows test by yisi</title>
|
<style>
|
table {
|
border-collapse: collapse;
|
}
|
|
th,
|
td {
|
border: 40px solid #999;
|
padding: 0 10px;
|
width: 100px;
|
height: 50px;
|
}
|
|
.relpos {
|
background-color: pink;
|
}
|
|
.relpos-th {
|
position: relative;
|
top: -50px;
|
background: lightskyblue;
|
}
|
|
.relpos-thead {
|
background-color: pink;
|
position: relative;
|
top: 70px;
|
}
|
|
.relpos-cell {
|
position: relative;
|
top: 70px;
|
height: 160px;
|
background-color: orange;
|
}
|
|
.relpos-row {
|
position: relative;
|
top: 110px;
|
background-color: teal;
|
}
|
</style>
|
</head>
|
|
<body>
|
<table>
|
<thead class="relpos-thead">
|
<th class="relpos-th">表格头1</th>
|
<th>表格头2</th>
|
</thead>
|
<tr>
|
<td class="relpos-cell">foo</td>
|
<td>bar</td>
|
</tr>
|
<tr class="relpos-row">
|
<td>foo</td>
|
<td>bar</td>
|
</tr>
|
<tr>
|
</table>
|
</body>
|
</html>
|