Go Back   HTMLCenter Web Development Forums > Web Design and Development > Programming and Scripting

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-15-2002, 06:08 AM
Registered User
 
Join Date: Mar 2002
Posts: 6
how'd you do that?!

i'm trying to do something very simple, butit is turning out to be very complicated! all i want to do is create a small table-looking thing such as you have on your page. for example, on the left hand side you have 3 three small tables labeled 'Random Stuff', 'Search', and 'Newsletter'. how did you create the table with the thin black outline? did you use cascading style sheets?

Also, if you go tohttp://www.deskmod.com you will see a better example of what i mean. There, the author has created similar looking tables but with rounded edges. Could you please give me some advice as to how i could go about doing the same thing?
thanks, darren
Reply With Quote

  #2 (permalink)  
Old 03-15-2002, 01:16 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
Lightbulb nested tables

Hi Darren!

What you long for is usually achieved by using nested tables and the infamous "spacer.gif".

Some code:

Code:
<table border="0" cellpadding="0" cellspacing="0">
<!-- upper outline -->
<tr><td colspan="3" bgcolor="#000000"><img src="spacer.gif" width="1" height="1"></td></tr>
<!-- eof upper outline -->
<tr>
<!-- left outline -->
<td bgcolor="#000000"><img src="spacer.gif" width="1" 
height="1"></td>
<!-- eof left outline -->
<!-- middle -->
<td>
<table border="0">
<tr><td>
Random Stuff<br>
Search<br>
...<br>
</td></tr>
</table>
</td>
<!-- eof middle -->
<!-- right outline -->
<td bgcolor="#000000"><img src="spacer.gif" width="1" height="1"></td>
<!-- eof right outline -->
</tr>
<!-- bottom outline -->
<tr><td colspan="3" bgcolor="#000000"><img src="spacer.gif" width="1" height="1"></td></tr>
<!-- eof bottom outline -->
</table>
Some explainage.

This creates a nested table with a black outline (that is, if spacer.gif is black as well).

I have three rows in the outter table. One doing the upper part, one for the middle (that is left side, middle, right side) and one doing the bottom part. In the middle, I put another table to format it all nicely.

If you want to achieve something like DeskMod, you'd have to create seperate cells for the corners, instead of spanning top and bottom row accross all three colums (rowspan="3").

I included some HTML comments (<!-- ... -->) to show you what I was talking about. The eof shows you where it ends.

I hope that helps.
Reply With Quote
  #3 (permalink)  
Old 03-17-2002, 05:55 PM
Registered User
 
Join Date: Jan 2002
Location: Pittsburgh, PA, USA
Posts: 48
Send a message via ICQ to Nate Send a message via AIM to Nate Send a message via Yahoo to Nate
Darren,

Although Till's way will work, there's a much easier way with a simple nested table. Basically, you make the outer table a background color with a cellspacing of 1 (to create the outline) then make another table with set bgcolor props...see below.

Code:
<!-- start outside table for outline --> 
<table bgcolor="#000000" cellspacing=0 cellpadding=1 border=0><tr><td> 
<!-- start inner table for content --> 
<table bgcolor="#EEEEEE" cellspacing=0 cellpadding=5 border=0> 
<!-- upper cell: --> 
<tr><td bgcolor="#888888"> 
<p align="center"><font face="Verdana, Arial, Helvetica, Sans" size=2 color="#EEEEEE">Moo</font></p> 
</td></tr> 
<!-- lower cell: --> 
<tr><td> 
<p><font face="Verdana, Arial, Helvetica, Sans" size=2>Blah blah blah, etc.</font></p> 
</td></tr> 
</table> 
<!-- end inner table for content --> 
</table> 
<!-- end outside table for outline -->
I find that much easier than trying to play around with spacers in cells. This also allows you to have a cellpadding amount (margin) for the inner table (so your content isn't right up against the outside).

Hope that helps,
Nate

P.S. The corners on deskmod are graphics, and that gets a lot more complicated (personally, I hate to use graphics the way deskmod does just because of browser errors and misrenderings).

Last edited by Nate : 03-19-2002 at 07:52 PM.
Reply With Quote
  #4 (permalink)  
Old 03-19-2002, 06:38 AM
tthurgo's Avatar
Moderator
 
Join Date: Jan 2002
Location: Lebanon, PA
Posts: 357
Re: nested tables

Quote:
Originally posted by Till
the infamous "spacer.gif"
If you had a copyright on "spacer.gif" today, you could probably make millions.
Reply With Quote
  #5 (permalink)  
Old 03-19-2002, 06:43 AM
tthurgo's Avatar
Moderator
 
Join Date: Jan 2002
Location: Lebanon, PA
Posts: 357
Thumbs down no worky

Quote:
Originally posted by Nate
(...)
Nate,

I copied and pasted your's into my browser (Netscape 4.7 ) and it didn't work.

Tom
Reply With Quote
  #6 (permalink)  
Old 03-19-2002, 07:54 PM
Registered User
 
Join Date: Jan 2002
Location: Pittsburgh, PA, USA
Posts: 48
Send a message via ICQ to Nate Send a message via AIM to Nate Send a message via Yahoo to Nate
Yup, my fault...I had a typo (I mixed up the cellspacing and cellpadding value on the outter table - I still have problems remembering which is which). As usual, IE had no problems, but NS chokes. My original post is now correct.

Nate
Reply With Quote
  #7 (permalink)  
Old 03-24-2002, 11:16 AM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
cellpadding and cellspacing are evil! I never know which is which.
Reply With Quote
  #8 (permalink)  
Old 04-01-2002, 11:26 AM
Registered User
 
Join Date: Mar 2002
Location: Indianapolis USA
Posts: 27
Quote:
Originally posted by Till
cellpadding and cellspacing are evil! I never know which is which.
You guys too - I thought I was the only 'cell-challenged' being on the planet

Only way I can remember it is to think of a "padded cell" - no, not from experience, thanks for wondering - which reminds me the padding is on the inside.
__________________
Mike.
- -
Atlantic Bridge Publishing
Reply With Quote
  #9 (permalink)  
Old 04-01-2002, 12:21 PM
Allen's Avatar
Administrator
 
Join Date: Dec 2001
Location: Atlanta, Georgia, USA
Posts: 1,037
HAH!

Padding on inside, spacing on outside... like a bed mattress...

Glad to see ya back Mike!
Reply With Quote
  #10 (permalink)  
Old 04-01-2002, 02:47 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
Quote:
Originally posted by Allen
Padding on inside, spacing on outside... like a bed mattress...
That sounds way too easy to me.
Reply With Quote
  #11 (permalink)  
Old 04-01-2002, 06:22 PM
Registered User
 
Join Date: Jan 2002
Location: Pittsburgh, PA, USA
Posts: 48
Send a message via ICQ to Nate Send a message via AIM to Nate Send a message via Yahoo to Nate
Quote:
Originally posted by Allen
Padding on inside, spacing on outside... like a bed mattress...
i sleep on the floor...
Reply With Quote
  #12 (permalink)  
Old 04-21-2002, 03:03 PM
Registered User
 
Join Date: Mar 2002
Location: Indianapolis USA
Posts: 27
Quote:
Originally posted by Nate
i sleep on the floor...
That's OK - as long as it's not in a cell of course
__________________
Mike.
- -
Atlantic Bridge Publishing
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 11:22 PM.

 
KickApps
Clicky Web Analytics


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter