21 users online (0 members and 21 guests)  


  Results 1 to 3 of 3

Related

  1. GET and POST methods    Forum: PHP Forum
    Replies: 3
  2. NOT EQUAL methods??    Forum: Javascript Forum
    Replies: 2
  1. #1
    lsachs's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Posts
    21

    Favorite methods for creating 1px borders

    I'm doing an informal survey on how everyone handles 1 px borders for tables. I'm particularly interested in borders within tables, esp. those that "float" between cells. Here's various methods I've used and seen:



    1. A table with a bgcolor and white cells inside of it.
    2. For, say a vertical border btween cells, a separate cell with its own bgcolor sitting between the 2 cells.
    3. Using a colored HR with the noshade tag
    4. A table directly within a table, the outside table with bordercolor white and the inside with the bordercolor of choice. Yahoo seems to do this a lot, even though it starts off with lots of tables.
      <TABLE cellSpacing=1 cellPadding=1 width=500 align=center
      border=0><TBODY>
      <TR bgColor=#006599>
      <TD>
      <TABLE cellSpacing=4 cellPadding=6 width="100%"
      bgColor=#ffffff border=0>
      <TBODY>
      <TR bgColor=#eeeeee>
      <TD> </TD>
      </TR>
      </TBODY>
      </TABLE></TD></TR></TBODY></TABLE>
    5. Any other ideas???

    This isn't really about browser compatibility, but that's a factor as well. I'm more interested in the scope of solutions and why people choose what method they choose

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Great question!

    Without a doubt CSS should be considered. I just got home from a job and have to get back to work changing AHFB to XHTML, but a great example of what I am doing can be found in the php scripts section.

    Dave
    Last edited by HTML; 03-23-2009 at 04:23 PM.

  3. #3
    Android's Avatar

    Status
    Offline
    Join Date
    Oct 2002
    Location
    I AM CANADIAN
    Posts
    440

    Talking Css

    How about nested divs.
    One div with a margin of 1px inside another div that has a different background colour.
    Or, rather than a margin of 1px on the inner div, you could have a padding of 1px on the outer div.
    Maybe I've got it backwards? I've done it. You can create borders of repeated images that way by using an image as the background of the outer div as well, instead of the regular solid or ridged, etc. kind of borders. Makes for interesting borders sometimes.



Tags for this Thread