How do I place an html table at the very top of the screen?

Using html and css for IE7, how do I place the html table at the very top of the screen without the top border that is automatically generated?

I am developing into vs2008.

+2


source to share


2 answers


You are probably seeing default margins for the document body. Set margin to 0 on body, preferably using css. I recommend using reset css to set the default styling for your pages in each browser, there are only a few on the web. Example:



html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
}
body {
    line-height: 1;
}

      

+4


source


Remove the border in the table.

CSS Approach:

table / #id-of-your-table / .class-of-your-table { border: 0; }

      



The inline style approach:

<table style="border: 0;"> ... </table>

      

+1


source







All Articles