Old 05-04-2006, 17:05   #1 (permalink)
buyinkonline
Registered User
 
Join Date: Jan 2006
Posts: 8
Web Page Alignment

Can anyone help me. I made and published my own business website but am having problems with it. It only aligns correctly on my screen and no other. Can anyone help me align it so it is centered on all screen resolutions and all browsers.
  Reply With Quote
Old 05-04-2006, 17:08   #2 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 828
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
No link....no code......no chance!

- Mike
  Reply With Quote
Old 05-04-2006, 17:12   #3 (permalink)
buyinkonline
Registered User
 
Join Date: Jan 2006
Posts: 8
Quote:
Originally Posted by MikeMackay
No link....no code......no chance!

- Mike

Sorry www.jpbcouriers.co.uk
  Reply With Quote
Old 05-04-2006, 17:20   #4 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 828
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Well I presume you are trying to center the entire table in the browser ?

In which case, you have this code:

Code:
<div align="center"></div> <table width="1027" border="0" cellpadding="0" cellspacing="0"> ... </table>

Which you should replace with:

Code:
<div align="center"> <table width="1027" border="0" cellpadding="0" cellspacing="0"> ... </table> </div>

Basically your centering div stops before the table so the table cannot be aligned with it. Move the </div> to right after the </table>. The div will then encompass the entire table and align it in the center of the screen.

By the way, times have changed and using tables for layout is old-fashioned and over-bloating HTML. CSS is the way forward however I won't lecture you on that as you simply asked for a straight forward answer to a problem with your current code

- Mike
  Reply With Quote
Old 05-04-2006, 17:26   #5 (permalink)
buyinkonline
Registered User
 
Join Date: Jan 2006
Posts: 8
Thank you very much. the savour to all my problems
  Reply With Quote
Old 06-04-2006, 06:05   #6 (permalink)
Nudoo
Senior Member
 
Join Date: Mar 2006
Posts: 131
You could try to center within the cascading style sheet (css)

html
Code:
replace <div align="center"> with <div id="container">

css
Code:
body { margin:0px; padding:0px; text-align:center; } div#container { margin-left:auto; margin-right:auto; text-align:left; width:xxxp; }
  Reply With Quote
Old 06-04-2006, 06:29   #7 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 828
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by Nudoo
You could try to center within the cascading style sheet (css)

html
Code:
replace <div align="center"> with <div id="container">

css
Code:
body { margin:0px; padding:0px; text-align:center; } div#container { margin-left:auto; margin-right:auto; text-align:left; width:xxxp; }


Fair point but the OP didn't have any CSS styles in use on his site at the time, therefore it would have been more long-winded to have gone down that route and may have added confusion seeing as this was his first website. I did mention about CSS but instead just answered his question.

- Mike
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8