tags:

views:

50

answers:

3

I have a page with the container in a table I need to align it to the topmost of the page, but there is a gap. Also need to center the page horizontally.

I tried

body {
    margin:0px;
    padding:0px;
}
+1  A: 

Try:

html, body {
    border: 0px;
    margin: 0px;
    padding: 0px;
}

table {
    margin: 0px auto;
}
Frédéric Hamidi
This aperently centered the table but there is still a gap on top.
Rick
Does your table reside in a `<form>`, a `<div>` or another container?
Frédéric Hamidi
Only tables, no div nor forms.
Rick
Check your first row of cells, you might have some `border`, `margin` or `padding` set on your `<th>` or `<td>` elements.
Frédéric Hamidi
+1  A: 

This might work.

* {margin:0; padding:0;}

table#idName {
    margin:auto;
}
Freyr
A: 

what is the first child element of the div? Have you zeroed the top margin on that element (or given the div a small top padding or border)?

wolfcry911