User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 403,403 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,590 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 579 | Replies: 3
Reply
Join Date: Apr 2008
Posts: 4
Reputation: sapamtiken is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sapamtiken sapamtiken is offline Offline
Newbie Poster

To align the whole web page in the centre of the page

  #1  
Apr 10th, 2008
THis is the home page of my website. The problem is that when it is viewed from 800x600 screen resolution it is showing nicely. But when it is viewed from a screen with a higher resololution, the whole page is aligned to the left. Please tell the code to align the whole web page in the centre of the page.

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html XMLNS:ASP>
  3. <head>
  4. <title>default</title>
  5. <meta content="JavaScript" name="vs_defaultClientScript">
  6. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  7. <meta content="Microsoft FrontPage 6.0" name="GENERATOR">
  8. <meta content="FrontPage.Editor.Document" name="ProgId">
  9. <meta content="Microsoft Visual Studio.NET 7.0" name="Originator">
  10. <style fprolloverstyle>A:hover {color: #FF0000; font-style: italic; font-weight: bold}
  11. </style>
  12. <script language="javascript" id="clientEventHandlersJS">
  13. <!--
  14. function MARQUEE1_onclick() {
  15.  
  16. }
  17.  
  18. function MM_swapImgRestore() { //v3.0
  19. var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  20. }
  21.  
  22. function MM_preloadImages() { //v3.0
  23. var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  24. var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  25. if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  26. }
  27.  
  28. function MM_findObj(n, d) { //v4.01
  29. var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  30. d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  31. if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  32. for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  33. if(!x && d.getElementById) x=d.getElementById(n); return x;
  34. }
  35.  
  36. function MM_swapImage() { //v3.0
  37. var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  38. if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  39. }
  40. function MARQUEE1_onclick() {
  41.  
  42. }
  43.  
  44. function MARQUEE1_onclick() {
  45.  
  46. }
  47.  
  48. //-->
  49.  
  50. </script>
  51. </head>
  52. <body style="TEXT-ALIGN: center" vLink="#000000" aLink="#000000" link="#000000" bgColor="lightgrey" leftMargin="1" topMargin="1" onload="MM_preloadImages('Images/ro2.jpg')" rightMargin="1" MS_POSITIONING="GridLayout">
  53. <form id="Form1" style="BACKGROUND-COLOR: #cccccc" method="post" runat="server">
  54. <TABLE id="Table3" style="Z-INDEX: 102; LEFT: 0px; WIDTH: 782px; POSITION: absolute; TOP: 0px; HEIGHT: 112px" borderColor="#ffffff" cellSpacing="0" cellPadding="0" width="770" border="0">
  55. <TR>
  56. <TD style="WIDTH: 773px; HEIGHT: 180px" align="middle" colSpan="3">&nbsp;<SPAN></SPAN><!--webbot bot="Include" U-Include="top.htm" TAG="BODY" startspan -->
  57. <TABLE id="Table2" style="Z-INDEX: 101; LEFT: 0px; WIDTH: 777px; POSITION: absolute; TOP: -1px; HEIGHT: 182px" cellSpacing="0" cellPadding="0" width="777" border="0">
  58. <TR>
  59. <TD vAlign="top" height="110"><IMG style="WIDTH: 772px; HEIGHT: 108px" height="108" src="Images/top.jpg" width="772"><br>
  60. <B><FONT face="Verdana" size="1"><IMG style="WIDTH: 774px; HEIGHT: 10px" height="10" src="Images/bar.gif" width="774"></FONT></B></TD>
  61. </TR>
  62. <TR>
  63. <TD vAlign="top" align="middle">
  64. <TABLE id="Table1" style="BORDER-COLLAPSE: collapse" borderColor="#111111" cellSpacing="0" cellPadding="0" width="768" border="0">
  65. <TR>
  66. <TD style="HEIGHT: 22px" vAlign="center" align="middle" width="100%" bgColor="silver" height="22"><B><FONT face="Verdana" size="1">&nbsp;
  67. <A class="menu" href="default.htm" target="">Home</A> | <A class="menu" href="c_about_us.htm" target="">
  68. About Us</A> | <A class="menu" href="c_about_sainik_schools.htm" target="">Sainik
  69. Schools </A>| <A class="menu" href="c_admission_procedure.htm" target="">Admission
  70. Procedure</A> | <A class="menu" href="SAINIK SCHOOL IMPHAL.pdf" target="">Application
  71. Form</A>| <A class="menu" href="c_application_form.htm" target="">Application
  72. Details</A>| <A class="menu" href="c_bond_agreement.htm" target="">Bond
  73. Agreement</A>| <A class="menu" href="c_correspondence.htm" target="">Correspondence</A>&nbsp;|<A class="menu" href="c_education.htm" target="">
  74. Education</A>| <A class="menu" href="c_facilities_available.htm" target="">Facilities</A>
  75. |<A class="menu" href="c_hostel_messing.htm" target=""> Hostel and Messing</A>|<A class="menu" href="c_other_activities.htm" target="">
  76. Other Activities</A>|<A class="menu" href="c_other_information.htm" target=""> Other
  77. Information</A> |<A class="menu" href="c_scholarship.htm" target=""> Scholarship</A>
  78. |<A class="menu" href="c_withdrawal.htm" target=""> Withdrawal</A> |<A class="menu" href="Dynamicpage/c_adm.aspx" target="">
  79. Student Detail</A>&nbsp;
  80. <br>
  81. |<A class="menu" href="c_faculty.htm" target=""> Faculty</A> |<A class="menu" href="c_photo1.htm" target="_blank">
  82. Photo Gallery</A> </FONT></B>
  83. </TD>
  84. </TR>
  85. </TABLE>
  86. </TD>
  87. </TR>
  88. </TABLE>
  89. <MARQUEE style="DISPLAY: inline; Z-INDEX: 103; LEFT: 9px; VISIBILITY: visible; FONT: caption; TEXT-TRANSFORM: capitalize; WIDTH: 763px; COLOR: #3300ff; POSITION: absolute; TOP: 157px; HEIGHT: 22px; BACKGROUND-COLOR: white" scrollAmount="3" id="MARQUEE1" language="javascript" onclick="return MARQUEE1_onclick()"><FONT size="3">Sainik
  90. School Imphal (Manipur), India, PIN-795001</FONT></MARQUEE>
  91. &nbsp;
  92. <!--webbot bot="Include" i-checksum="7661" endspan --></TD>
  93. </TR>
  94. <TR>
  95. <TD style="WIDTH: 162px; HEIGHT: 53px; TEXT-ALIGN: center" vAlign="top" align="middle" bgColor="#99cc33" colSpan="3">
  96. <P align="center">
  97. <TABLE id="Table4" style="VERTICAL-ALIGN: baseline; WIDTH: 782px; HEIGHT: 39px; TEXT-ALIGN: center" cellSpacing="1" cellPadding="1" width="782" align="center" bgColor="#ff0033" border="2">
  98. <TR>
  99. <TD vAlign="center" borderColor="#33cc66" align="middle" bgColor="#ff0033" colSpan="1" rowSpan="1"><STRONG><FONT style="TEXT-ALIGN: center" color="#ffffff"><FONT face="Trebuchet MS"><FONT size="5">PHOTOS
  100. OF SCHOOL TOPPERS </FONT><A class="menu" href="toppers.htm" target="_blank"><FONT color="#ffffff" size="5">
  101. Click Here</FONT></A><FONT size="5"> </FONT></FONT></FONT></STRONG>
  102. </TD>
  103. </TR>
  104. </TABLE>
  105. </P>
  106. </TD>
  107. </TR>
  108. <TR>
  109. <TD style="WIDTH: 10px; TEXT-ALIGN: center" vAlign="top" align="middle" bgColor="#99cc33"><A onmouseover="MM_swapImage('ro','','Images/ro2.jpg',1)" onmouseout="MM_swapImgRestore()" href="#"></A>&nbsp;
  110. <p>
  111. </p>
  112. </TD>
  113. <TD style="WIDTH: 581px" align="middle" bgColor="#99cc33"><P align="center"><IMG src="Images/ssi.jpg"></P>
  114. </TD>
  115. <TD style="WIDTH: 155px" align="middle" bgColor="#99cc33"><TABLE id="Table5" style="WIDTH: 165px; HEIGHT: 157px" cellSpacing="0" cellPadding="0" width="165" border="0">
  116. <TR>
  117. <TD align="middle"></TD>
  118. </TR>
  119. <TR>
  120. <TD align="middle">
  121. <TABLE id="Table6" style="FONT: messagebox; WIDTH: 123px; HEIGHT: 249px" cellSpacing="0" cellPadding="0" width="123" border="0">
  122. <TR>
  123. <TD style="FONT: caption; COLOR: #ffffff; BACKGROUND-COLOR: #009933" align="middle">Contact
  124. Details</TD>
  125. </TR>
  126. <TR>
  127. <TD class="heading" style="COLOR: #ff0033" align="middle" width="128" bgColor="#ffff66" height="21"><B>Phone
  128. No<FONT style="BACKGROUND-COLOR: #ffff66" color="#ffff66"> </FONT></B>
  129. </TD>
  130. </TR>
  131. <TR>
  132. <TD class="txt11" style="COLOR: #ff0033" borderColor="#ffff66" borderColorLight="#ffff66" align="middle" width="128" bgColor="#ffff66" borderColorDark="#ffff66" height="22">09862468237
  133. </TD>
  134. </TR>
  135. <TR>
  136. <TD width="128" bgColor="#ffff66" height="3">
  137. <P align="center"></P>
  138. <P align="center"><FONT face="Verdana, Arial, Helvetica" color="#999999" size="1">-----------------------</FONT></P>
  139. </TD>
  140. <TR>
  141. <TD class="heading" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #ffff66" align="middle" width="128" bgColor="#3399ff" height="18">E-mail:</TD>
  142. </TR>
  143. <TR>
  144. <TD class="txt11" style="COLOR: #009900; TEXT-DECORATION: none" align="middle" width="128" bgColor="#3399ff" height="34"><A href="mailto:ssimphal@hotmail.com">ssimphal@hotmail.com</A></TD>
  145. </TR>
  146. <TR>
  147. <TD class="heading" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #ffff66; HEIGHT: 13px" align="middle" width="128" bgColor="#ff3333" height="13">Postal
  148. Address</TD>
  149. </TR>
  150. <TR>
  151. <TD class="txt11" style="COLOR: #ffff66" vAlign="top" align="middle" width="128" bgColor="#ff3333" height="44" rowSpan="4">Principal<BR>
  152. Sainik School Imphal<BR>
  153. Post Box No. 21<BR>
  154. Imphal<BR>
  155. Manipur,&nbsp;INDIA&nbsp;
  156. <BR>
  157. PIN: 795001</TD>
  158. </TR>
  159. </TABLE>
  160. <div align="center"></div>
  161. </TD>
  162. </TR>
  163. </TABLE>
  164. </TD>
  165. </TR>
  166. <TR>
  167. <TD style="WIDTH: 773px" vAlign="top" align="middle" bgColor="#99cc33" colSpan="3">
  168. <TABLE id="Table10" style="WIDTH: 745px; HEIGHT: 46px" cellSpacing="0" cellPadding="0" width="745" align="center" border="0">
  169. <TR>
  170. <TD style="FONT: caption; COLOR: #ffffff; HEIGHT: 55px" align="middle"><FONT color="#ffcc33" size="3">THE
  171. NEW LOOK FOR SAINIK SCHOOL IMPHAL ACADEMIC BLOCK</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  172. </TD>
  173. </TR>
  174. <TR>
  175. <TD style="FONT: caption; COLOR: #ffffff" align="middle">
  176. <P align="center">Principal's speech on the occassion of Annual Day October7, 2007 <A class="menu" href="c_principal_speech.htm" target="_blank">
  177. Click Here</A> <IMG height="11" src="Images/new.gif" width="20">
  178. <br>
  179. Newsletter April-September 2007<A class="menu" href="c_newsletter.htm" target="_blank">
  180. Click Here</A><IMG height="11" src="Images/new.gif" width="20"></P>
  181. </TD>
  182. </TR>
  183. </TABLE>
  184. </TD>
  185. </TR>
  186. <TR>
  187. <TD style="WIDTH: 773px" bgColor="#ccff99" colSpan="3">
  188. <TABLE id="Table7" style="WIDTH: 783px; HEIGHT: 46px" cellSpacing="0" cellPadding="0" width="783" align="center" border="0">
  189. <TR>
  190. <TD align="middle" bgColor="#0066ff">
  191. <div align="center"><STRONG><FONT color="#ffffff">Website is designed and&nbsp;developed
  192. by:
  193. <BR>
  194. </FONT><FONT color="#ffff00"><A class="menu" href="developer.htm" target="">Computer
  195. Science Dept., Sainik School Imphal</A></FONT></STRONG>
  196. </div>
  197. </TD>
  198. </TR>
  199. </TABLE>
  200. </TD>
  201. </TR>
  202. <TR>
  203. <TD style="WIDTH: 773px" bgColor="#ccff99" colSpan="3">
  204. <TABLE id="Table8" style="WIDTH: 782px; HEIGHT: 38px" cellSpacing="0" cellPadding="0" width="782" align="center" border="0">
  205. <TR>
  206. <TD align="middle">
  207. <div align="center"><FONT color="#cccc00"><FONT color="#3399ff">Hosted By:
  208. <BR>
  209. </FONT></FONT><FONT color="#6666ff">National Informatics Centre (NIC), Manipur
  210. State Unit, Imphal</FONT>
  211. </div>
  212. </TD>
  213. </TR>
  214. </TABLE>
  215. </TD>
  216. </TR>
  217. <TR>
  218. <TD style="WIDTH: 773px" bgColor="#ccff99" colSpan="3">
  219. <TABLE id="Table9" style="WIDTH: 782px; HEIGHT: 35px" cellSpacing="0" cellPadding="0" width="782" align="center" border="0">
  220. <TR>
  221. <TD align="middle">
  222. <HR>
  223. <div align="center"><STRONG>Disclaimer:&nbsp; Contents provided by the concerned school
  224. authority</STRONG></div>
  225. <DIV align="center"><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  226. Best viewed in 800 x 600 screen resolution</STRONG></DIV>
  227. </TD>
  228. </TR>
  229. </TABLE>
  230. </TD>
  231. </TR>
  232. </TABLE>
  233. </form>
  234. </body>
  235. </html>
Last edited by peter_budo : Apr 11th, 2008 at 8:10 pm. Reason: Keep It Organized - plase use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Location: Wales
Posts: 30
Reputation: BluePaper is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
BluePaper's Avatar
BluePaper BluePaper is offline Offline
Light Poster

Re: To align the whole web page in the centre of the page

  #2  
Apr 10th, 2008
Hey there, this is the wrong forum really, it should really go in http://www.daniweb.com/forums/forum143.html

However seeing as I'm here now I'll provide some help.

The best way to centre a page I have found in my expereince is to use a little margin/left thing. This goes in your style tags at the top (which to be honest to make your life easier you should move all styling to an external stylesheet but that is another learning hurdle.)

The following style code can be used:

  1. div.Surround {left:50%;margin-left:-391px;position:absolute;width:782px;}

You will also need to surround everything within the <body> tags that needs to be centred with <div class="Surround"></div>

It may require some fiddling but I'm sure you can work it out just ask otherwise.
Last edited by BluePaper : Apr 10th, 2008 at 2:03 pm. Reason: Fixing post. :|
Stone In Focus - Caffeine Group - CoffeePHP - Open Notes - Onyx - Redpoint Network - Espresso
Reply With Quote  
Join Date: Dec 2007
Posts: 287
Reputation: ericstenson is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 28
Colleague
ericstenson's Avatar
ericstenson ericstenson is offline Offline
Posting Whiz in Training

Re: To align the whole web page in the centre of the page

  #3  
Apr 10th, 2008
easiest way to do it is put everything in a table and center the table to the page (page style property -- text:center)
--
"Dummy."
Reply With Quote  
Join Date: Apr 2008
Posts: 4
Reputation: sapamtiken is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sapamtiken sapamtiken is offline Offline
Newbie Poster

Re: To align the whole web page in the centre of the page

  #4  
Apr 24th, 2008
Still I am having problem. Please rewrite the full code. Thank you for ur help.
SAPAM TIKEN SINGH
SINGJAMEI SAPAM LEIKAI
IMPHAL,MANIPUR
INDIA - 795008
E-mail: tikensapam@yahoo.co.in
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 9:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC