SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Stockholm, Sweden
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tables, top=0 left=0?

    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?

  2. #2
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    You need to set your default page margins to 0 in the body tag.

  3. #3
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your <body> tag, you need to put this code:

    Code:
    <body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginbottom="0">
    Hope that helps .

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Stockholm, Sweden
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  5. #5
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use css to position the table you can put them over the top of each other...

    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>
    Thats just an example of positioning.

    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.

  6. #6
    long gone but not forgotten AljapaCo's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?
    Put both tables inside a bigger table that has cellpadding="0" cellspacing="0"
    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.............

  7. #7
    SitePoint Zealot Snegolle's Avatar
    Join Date
    Jan 2002
    Location
    localhost
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <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

  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Stockholm, Sweden
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  9. #9
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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...

    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>
    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%".

    That make sense?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •