tags:

views:

143

answers:

2

I am trying to minimize the height of the table shown below. Firebug tells me that table's height is 29, tbody's 25, and both rows together's 23.

The layout tab does not show that there is any padding, margins or border. Though, it tells me that tbody has 2 pixel offset, and the same for tr. Is there a way to prevent that offset?

<body>
    <table style="width: 100%">
        <tr>
            <td>foo
            </td>
            <td>bar
            </td>
        </tr>
        <tr>
            <td colspan=2></td>
        </tr>
    </table>
</body>

Related question: Why do browsers insert tbody element into table elements?

+3  A: 

If I understood your question correctly, it looks like you want to do this on all your table elements:

padding:0px
border-collapse:collapse;

http://www.w3schools.com/Css/pr%5Ftab%5Fborder-collapse.asp

In general using a good reset.css should help you.

marcgg
+2  A: 

Maybe "CSS reset" will help: http://meyerweb.com/eric/tools/css/reset/ Some line deal with table.

Rin