How do I completely fill a <table> 100% with <tbody> in HTML?

末鹿安然 提交于 2020-07-18 03:30:29

问题


I have some HTML that inject with Javascript into a web page. The final HTML I inject looks like:

<table style="border-width: 0px; margin 0px; width:100%; height: 100%; padding:0px;">
    <tbody style="border-width: 0px; margin 0px; width:100%; height: 100%; padding:0px;">

For some odd reason when I examine tbody in Firebug, its size seems to be 4px smaller than the table. How do I get the to fill up ?


回答1:


try adding the following css to your table:

border-collapse: collapse;



回答2:


Try adding:

border-collapse: collapse;

To your table. Or try setting:

display: block;

or

display: table

on the tbody element.



来源:https://stackoverflow.com/questions/6658792/how-do-i-completely-fill-a-table-100-with-tbody-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!