我想一個表格單元格對齊列其所屬:對齊一個HTML表格單元格的列
_________________________________________
| | First Place | Second Place |
| | | |
_________________________________________
| 09:00 | | Break fast |
| | | 09:10 : 09:50 |
_________________________________________
但我得到的是下一個:
_________________________________________
| | First Place | Second Place |
| | | |
_________________________________________
| 09:00 | Break fast | |
| | 09:10 : 09:50 | |
_________________________________________
的HTML我正在使用的代碼/ css是下一個。任何想法如何通過啃我的HTML或CSS來實現上述效果真的很受歡迎。
table.dayEvent {
background-color: rgb(221, 221, 221);
border-collapse: separate;
display: table;
margin: 0px 0px 20px 0px;
width: 570px;
}
table.dayEvent caption {
color: rgb(46, 63, 153);
font-size: 18px;
text-transform: uppercase;
font-weight: bold;
margin: 10px 0px;
text-align: left;
}
table.dayEvent thead {
border-color: inherit;
display: table-header-group;
vertical-align: middle;
}
table.dayEvent tr {
vertical-align: top;
}
table.dayEvent th {
background: rgb(238, 238, 238);
padding: 10px;
text-align: left;
font-weight: bold;
}
.noDisplay {
display: none;
}
table.dayEvent td {
background: white;
padding: 10px;
}
table.dayEvent td p {
padding: 20px;
font-size: 14px;
line-height: 20px;
}
<table class="dayEvent">
<thead>
<tr>
<th></th>
<th axis="location" id="firstPlace">FirstPlace</th>
<th axis="location" id="secondPlace">FirstPlace</th>
</tr>
</thead>
<tbody>
<tr>
<th axis="T09:00" rowspan="12">09:00</th>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td rowspan="8" headers="secondPlace">
<p>Breakfast 9:10 - 9:50</p>
</td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
<tr>
<td class="noDisplay"> </td>
</tr>
</tbody>
</table>
這將是巨大的,從一個CSS的解決方案聽到!
不,不這樣做 - 第二個單元甚至不在所討論單元的同一行。 – Donut 2009-09-10 15:35:27
Doh'!!! 你是對的! – 2009-09-10 15:49:11