25

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 ?

Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
Zaheer
  • 2,794
  • 5
  • 28
  • 33

2 Answers2

27

Try adding:

border-collapse: collapse;

To your table. Or try setting:

display: block;

or

display: table

on the tbody element.

MichaelJones
  • 1,336
  • 2
  • 12
  • 22
ElonU Webdev
  • 2,451
  • 14
  • 15
19

try adding the following css to your table:

border-collapse: collapse;
Ben Rowe
  • 28,406
  • 6
  • 55
  • 75
  • Thanks for the quick response! Yes this fixed it! I wonder why though even though i specified border-width to be 0 it didn't have same effect. – Zaheer Jul 12 '11 at 02:36