【发布时间】:2019-02-11 10:20:35
【问题描述】:
我的表有一个标题列和剩余的数据列。 我希望有以下内容:
- 表格占屏幕宽度的 100%。
- 第一列的宽度固定为 150 像素。
- 其余列的宽度均分。
我已经发布了我的代码 here
#my-table{width:100%;border-collapse:collapse;} /*or whatever width you want*/ #my-table td{width:2000px;padding:4px;border:1px solid #000;vertical-align:top;} /*something big or 100%*/ #my-table td:first-child {width:150px;padding:4px;border:1px solid #000;vertical-align:top;}<table id="my-table"><tr> <td> CELL 1 Whith a lot of text in it</td> <td> CELL 2 </td> <td> CELL 3 </td> <td> CELL 4 Whith a lot of text in it </td> <td> CELL 5 </td> </tr></table>
感谢任何帮助。
【问题讨论】:
标签: html css html-table