<h4>垂直的表头:</h4>
<table border="1">
<tr>
<th>姓名</th>
<td>Bill Gates</td>
</tr>
<tr>
<th>电话</th>
<td>555 77 854</td>
</tr>
<tr>
<th>电话</th>
<td>555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855</td>
</tr>
</table>
</body>
</html>
姓名 | Bill Gates |
---|---|
电话 | 555 77 854 |
电话 | 555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855555 77 855 |
左边的表头我想要显示成一行的,有什么办法吗?
另:求推荐一些不错的 table 的样式。
谢谢解答
伊谢尔伦2017-04-17 13:43:28
Give <th>
a try with fixed width
th {
width: 100px;
min-width: 100px;
}
Be careful to limit the range when writing CSS, otherwise all TH will become fixed width.
怪我咯2017-04-17 13:43:28
By using the <colgroup> tag, you can apply styles to an entire column without having to repeatedly style each cell or row.
<colgroup>
<col width="20%">
<col width="80%">
</colgroup>
Click to view the table effect
Is this form good-looking?
What about this? Is it not bad?