html - CSS 表格样式
伊谢尔伦
伊谢尔伦 2017-04-17 13:41:28
0
3
1788
<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 的样式。

谢谢解答

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
伊谢尔伦

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.

Peter_Zhu

It’s not wide enough to fit, please make it wider

刘奇

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?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!