HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
centered table with 100% width bar/header
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
selectoe



Joined: 10 Mar 2008
Posts: 3

PostPosted: Mon Mar 10, 2008 4:55 pm     centered table with 100% width bar/header Reply with quote

Hi, I was wondering how this is done: having a table that is 750px wide, centered in the browser window, and having parts of the website extending to 100% width, as in www.zeald.com or www.stuelken.com/?ref=xampp.com

if you reduce the size of their windows, the table stays centered, and the bits to the sides of the table start disappearing.
ogsolution



Joined: 26 Dec 2007
Posts: 144

PostPosted: Mon Mar 10, 2008 11:04 pm     Reply with quote

The two websites you mentioned use different methods to layout their site. Personally, I would use the www.zeald.com way, which uses the following code:

Code:
<html>
<head>
   <style type="text/css">
      .wrapper{
         margin: 0px auto;
         display: block;
         width: 750px;
         background-color: gray;
      }
   </style>
</head>
<body>
   <div class="wrapper">
      Everything else here...
      <div style="width:1px; height:100px;">
   </div>
</body>
</html>
selectoe



Joined: 10 Mar 2008
Posts: 3

PostPosted: Thu Mar 13, 2008 4:01 pm     Reply with quote

thanks for the reply, but it does not seem to have the desired effect.

Last edited by selectoe on Sun Mar 16, 2008 1:58 pm; edited 1 time in total
ogsolution



Joined: 26 Dec 2007
Posts: 144

PostPosted: Thu Mar 13, 2008 9:39 pm     Reply with quote

Sorry, I didn't get what you meant the first time but I think I know now. You are talking about the extended blue portion on the top of the www.zeald.com page right?

If that's the case, you can do something like this:

Code:
<html>
<head>
   <style type="text/css">
      body{
       background: url(bg.gif) repeat-x top left;
       width: 100%;
       margin: 0px;
       padding: 0px;
      }
      #wrapper{
         margin: 0px auto;
         width: 750px;
         background-color: Gray;
      }
   </style>
</head>
<body>
   <div id="wrapper">
      contents here...
      <div style="width:1px; height:1000px;"></div>
   </div>
</body>
</html>


You can create a small repeatable background image and just use CSS to repeat horizontally on your body. Then center your wrapper div in the page and you'll get that effect.

Hope this helps.
selectoe



Joined: 10 Mar 2008
Posts: 3

PostPosted: Sun Mar 16, 2008 2:00 pm     Reply with quote

yes it does. thanks
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial