my tables are always a couple of pixels away from the top and left edge. How can i make the table attach to the edges like a layer can?
| SitePoint Sponsor |
my tables are always a couple of pixels away from the top and left edge. How can i make the table attach to the edges like a layer can?





You need to set your default page margins to 0 in the body tag.Code:<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">





In your <body> tag, you need to put this code:
Hope that helpsCode:<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginbottom="0">.
thanks. when I put a table underneath another table thers a little space betwen the two of them. when i center the tables the space goes away but it returns when i align them to the left, where i want them to be. How can i erase the space?





If you use css to position the table you can put them over the top of each other...
Thats just an example of positioning.Code:<table border="1" style="position:absolute;left:0;top:0"> <tr> <td>test cell 1</td> </tr> <tr> <td>test cell 2</td> </tr> </table> <table border="1" style="position:absolute;left:0;top:0"> <tr> <td>test cell 3</td> </tr> <tr> <td>test cell 4</td> </tr> </table>
www.w3schools.com for more info on positioning within the css category
Maelstrom Personal - Apparition Visions
Development - PhP || Mysql || Zend || Devshed
Unix - FreeBSD || FreeBsdForums || Man Pages
They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.



Put both tables inside a bigger table that has cellpadding="0" cellspacing="0"Originally posted by Kint
thanks. when I put a table underneath another table thers a little space betwen the two of them. when i center the tables the space goes away but it returns when i align them to the left, where i want them to be. How can i erase the space?
T O B I A S - S T R A N D H | visit my site here
OPERA7 /MSIE6 /FireFox 1.1/Win2000 /ADSL /17" Screen /1024x768
god doesn't create genius, he clones me.............

<body topmargin=0 leftmargin=0 rightmargin=0>-if you are designing for MSIE;
<body marginweight=0 marginheight=0>-if you are designing for NS and Opera
<body topmargin=0 leftmargin=0 rightmargin=0 marginweight=0 marginheight=0>-if you want fit it for all the browsers
No signature
ok, now for my last question regarding tables. If I have two tables (say tableA and tableB) inside another table and tableA is to the left of tableB. I want tableB to be fixed, not changing in width when i put text in it. As it is now, when i put text in TableB it grows in width and shrinks TableA (wich i also want fixed). How can i get pass this shrinking/growing thingy?
thanks in advance.





In this case you want to specify fixed width tables.
i.e. TABLE A has width attribute "x" in pixels, TABLE B has width "y" and TABLE C (your surrounding table) has width "x+y".
Then set the alignment of TABLES A and B accordingly...
If you want the main table to shrink width the size of the browser, but still want the 2 inner tables to keep the same proportions, use % values so TABLE C "100%" and for example TABLE A has "25%" and TABLE B has "75%".Code:<table width="800" border="1"> <tr> <td> <table width="300" border="1" align="left"> <tr> <td>content</td> </tr> </table> <table width="500" border="1" align="right"> <tr> <td>content</td> </tr> </table> </td> </tr> </table>
That make sense?
Bookmarks