24

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,096
  • 9
  • 36
  • 63
Zaheer
  • 2,664
  • 5
  • 26
  • 33

2 Answers2

25

Try adding:

border-collapse: collapse;

To your table. Or try setting:

display: block;

or

display: table

on the tbody element.

MichaelJones
  • 1,184
  • 2
  • 11
  • 21
ElonU Webdev
  • 2,433
  • 13
  • 15
18

try adding the following css to your table:

border-collapse: collapse;
Ben Rowe
  • 27,548
  • 6
  • 52
  • 73
  • 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