.table-normal { position: relative; display: block; margin: 10px auto; padding: 0; wIDth: 100%; height: auto; border-collapse: collapse; text-align: center;}.table-normal thead tr { background-color: #E74C3C; Font-weight: bold;}.table-normal tr { margin: 0; padding: 0; border: 0; border: 1px solID #999; wIDth: 100%;}.table-normal tr td { margin: 0; padding: 4px 8px; border: 0; border: 1px solID #999;}.table-normal tbody tr:nth-child(2) { background-color: #EEE;}
<table ID="top-leader" > <thead> <tr> <td>position</td> <td>name</td> <td>Kills</td> <td>Deaths</td> </tr> </thead> <tbody> <tr> <td>1</td> <td>John Doe</td> <td>16 Kills</td> <td>0 Deaths</td> </tr> <tr> <td>2</td> <td>John Smith</td> <td>13 Kils</td> <td>1 Death</td> </tr> <tr> <td>3</td> <td>Bob Smith</td> <td>11 Kills</td> <td>0 Deaths</td> </tr> </tbody></table>解决方法 删除display:block in .table-normal
Fiddle
.table-normal { position: relative; //display: block; margin: 10px auto; padding: 0; wIDth: 100%; height: auto; border-collapse: collapse; text-align: center;}总结
以上是内存溢出为你收集整理的html – 表格行未扩展到全宽全部内容,希望文章能够帮你解决html – 表格行未扩展到全宽所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)