HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 8th, 2008, 08:23 AM
mikeatvillage mikeatvillage is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Location: Powys/Shrops border (UK)
Posts: 90 mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 2 h 49 m 56 sec
Reputation Power: 5
Send a message via Yahoo to mikeatvillage
Setting my pages to a fixed width

Hi,

I'm currently using something like this to fix the width of my pages to 800px in the centre of the screen

<table width="100%" border="0" align="center" valign="center">
<tr>
<td></td>
<td width="800"> All my page content here </td>
<td></td>
</tr>
</table>

Is there a better/easier/tidier way ?

TVM

Mike
__________________
If my plea for help relates to a "Sheep", "Flock" or "Medicines" application then it's PHP 4.4.7 and MySQL 4.1.20
Everything else will be PHP 4.3.8 and MySql 4.0.21

Reply With Quote
  #2  
Old May 8th, 2008, 10:42 AM
Twisted_Daemon Twisted_Daemon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 12 Twisted_Daemon User rank is Corporal (100 - 500 Reputation Level)Twisted_Daemon User rank is Corporal (100 - 500 Reputation Level)Twisted_Daemon User rank is Corporal (100 - 500 Reputation Level)Twisted_Daemon User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 57 m 26 sec
Reputation Power: 0
You could try using <div> tags and linking to css.

For example :
<div id="container">
Content would go here.
</div>
This would go in the HTML

#container {
height : 100%
width : 800px
}
This would go in the CSS

Using tables for layout is being discouraged by the standards people.

Hope that helps

Reply With Quote
  #3  
Old May 8th, 2008, 12:37 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Click here for more information.
 
Join Date: Jul 2004
Location: USA
Posts: 15,149 Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 5th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 2 Weeks 2 Days 2 h 47 m 18 sec
Reputation Power: 1294
Twisted_Daemon didn't get the CSS rule quite right:
Code:
#container {
  width: 800px;
  margin: 0 auto;
}

You'll need extra code if you want it centered in IE5.x/Win too.

I suggest you learn how semantics apply to X/HTML. Semantics is really a very important subject when it comes to X/HTML.
__________________
Spreading knowledge, one newbie at a time.

Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

IE7: the generation 7 browser new in a world of generation 8 browsers.
Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

Reply With Quote
  #4  
Old May 9th, 2008, 03:37 AM
mikeatvillage mikeatvillage is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Location: Powys/Shrops border (UK)
Posts: 90 mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 2 h 49 m 56 sec
Reputation Power: 5
Send a message via Yahoo to mikeatvillage
Thanks both. I'd looked at DIV but couldn't find the "width" parameter. I'll switch to using that rather than tables.

The other query I had about this was that on a slow connection the left (empty) table column was loading, then the centre (with content), then the right (empty)... and this was causing the pages to load and then jump to the centre. I'll soon find out if DIVs do the same. If they do, can you think of any way of stopping that ?

ATB and many thanks again.

Mike

Reply With Quote
  #5  
Old May 9th, 2008, 06:11 AM
GameYin GameYin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Whiteford, MD
Posts: 348 GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 11 h 54 m
Warnings Level: 5
Reputation Power: 60
Send a message via AIM to GameYin
MySpace
Quote:
Thanks both. I'd looked at DIV but couldn't find the "width" parameter.

There are no parameters for width. If you are talking about CSS, it's called a property.
selector { property: value; }

Example:

#container { width: 800px; }
Comments on this post
mikeatvillage agrees: Sorry, that's what I meant... I'm not really 'with it' today
__________________
Adwords Professional
You can give me

Reply With Quote
  #6  
Old May 9th, 2008, 07:49 AM
GameYin GameYin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Whiteford, MD
Posts: 348 GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 11 h 54 m
Warnings Level: 5
Reputation Power: 60
Send a message via AIM to GameYin
MySpace
So did that help you? There is a width ATTRIBUTE, but it is depreciated and you shouldn't use it. CSS should be for styling the page. The makers wouldn't have invented CSS if it wasn't worth it

Reply With Quote
  #7  
Old May 9th, 2008, 09:34 AM
mikeatvillage mikeatvillage is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Location: Powys/Shrops border (UK)
Posts: 90 mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level)mikeatvillage User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 2 h 49 m 56 sec
Reputation Power: 5
Send a message via Yahoo to mikeatvillage
Sorry, not had a chance to try it yet - keep getting asked to WORK ! and as this particular database project is personal I have to obey.

I'm gradually finding things I've used on my site I really shouldn't and I'm starting to learn about a CSS (with much help from folks here) so heading down that route.

ATB

Mike

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Setting my pages to a fixed width


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway