• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Calling All Borders

Creating a bordered text box in CSS is pretty easy, but if you can’t use CSS on your site (sob!), there’s a way to get the same effect with tables (yay!). The trick is to nest one table inside another where the outer table has both a background color (that becomes your border) and a small amount of cell padding (which translates into the border width). The inner table is set to 100% width, a larger cell padding value, to keep it away from the outer border, and given its own background color. The interesting thing about using this technique to create a border is that no border attributes are used—or rather, they are specifically not used and set to 0—for both tables. Here’s some sample code to gnaw on:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint