Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 117,572 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,828 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



how do i align codes?

 
Reply to this topicStart new topic

how do i align codes?

DestroyeRHero
post 20 Jul, 2008 - 10:56 AM
Post #1


New D.I.C Head

*
Joined: 6 Jul, 2008
Posts: 15


My Contributions


hey im having a little trouble with aligning codes on my game, they dont seem to go where i cant them to.
i have a login box that i want centred, ive tried <centre> code </centre> yet it still remains on the left hand side.
where am i going wrong lol
by the way im doing this in php

thanks
User is offlineProfile CardPM

Go to the top of the page


Martyr2
post 20 Jul, 2008 - 11:17 AM
Post #2


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 4,604



Thanked 116 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


First of all this doesn't sound like a PHP issue per say, it sounds like a display issue as in HTML/CSS.

Second you will need to give us the URL of your page you are having trouble with as well as any HTML/CSS/PHP code for the problem in question.

We can't help diagnose anything we can't see. Thanks for helping us help you. smile.gif
User is offlineProfile CardPM

Go to the top of the page

DestroyeRHero
post 20 Jul, 2008 - 11:32 AM
Post #3


New D.I.C Head

*
Joined: 6 Jul, 2008
Posts: 15


My Contributions


hey as you know from my email ages ago im kinda new to this, im learning as i go lol with the great help from you guys on dic.
the temp link is http://195.12.48.96/~dhrpgcou/
im tryin to get the login into the centre of the page and the footer at the bottom lol

thanks mate
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 20 Jul, 2008 - 11:35 AM
Post #4


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,831



Thanked 80 times

Dream Kudos: 8050

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


Moved to HTML/CSS
User is online!Profile CardPM

Go to the top of the page

Martyr2
post 20 Jul, 2008 - 11:43 AM
Post #5


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 4,604



Thanked 116 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


The first thing you need to do DestroyeR is make sure the page is in the proper format. That is that it has a <html>,<head>,<title> tags and closing tags. Go to any HTML tutorial on the web to figure out how this is done.

Second, the www was heavily influenced by us crazy americans back in the day so the spelling of centre is actually "center".

You also didn't finish your table. Make sure your PHP is spitting out correct HTML format. I see no </tr> or </table> closing tags at the end.

Next you can put your login form inside something like a <div> tag which then through CSS you can align to center. Look up <div> tags on the net if you are unfamiliar with how they work.

So fix these things up and if you are still having problems, republish your site with the updates and let us know on this thread again.

And thanks for putting your replies in this thread instead of PM. smile.gif
User is offlineProfile CardPM

Go to the top of the page

BenignDesign
post 20 Jul, 2008 - 11:44 AM
Post #6


Dorkerella

Group Icon
Joined: 28 Sep, 2007
Posts: 841



Thanked 2 times

Dream Kudos: 150
My Contributions


Have you tried <center></center> instead of <centre></centre>?

This fixed the issue on my screen.

This post has been edited by BenignDesign: 20 Jul, 2008 - 11:45 AM
User is offlineProfile CardPM

Go to the top of the page

DestroyeRHero
post 20 Jul, 2008 - 11:46 AM
Post #7


New D.I.C Head

*
Joined: 6 Jul, 2008
Posts: 15


My Contributions


lol thanks matr, not bad for a first bit of coding tho is it haha

dam american spellings lmao that could solve alot of my problems xD
User is offlineProfile CardPM

Go to the top of the page

Martyr2
post 20 Jul, 2008 - 11:52 AM
Post #8


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 4,604



Thanked 116 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


Here is a taste of what your page could look like with some of these changes made (oh and btw <center> tags work but they are a bit discouraged to use these days).

CODE

<html>
<head>
<title>My Page</title>
<style>


body {
background-image:url("http://images.layouts.fm/0/24/24362.gif");
background-repeat:no-repeat;
background-position:center;
background-attachment:fixed;}

table, tr, td, input, div {
background-color:transparent; border:0px;}
a img {border:0px;}

table table table td {filter:alpha(opacity=89); opacity:0.89; -khtml-opacity:0.89;}
table table table {
border-color:000000;
border-style:double;
border-width:3px;}
table table table table td {background-image:none; background-color:transparent; filter:none; opacity:1;}
table table table {width:300px;}
td.text table {width:auto;}
table table table table {border:0px;}

td.text td.text table table td img, td.text td.text table table td embed {width:260px; max-width:260px; width:auto;}
td.text td.text table table td a img {width:90px; max-width:260px; width:auto;}
td.text td.text table table td div img {width:80px;}
* html td.text td.text table table td img, html td.text td.text table table td embed {width:260px;}
* html td.text td.text table table td a img {width:90px;}
* html td.text td.text table table td div img {width:80px;}

a:link, a:active, a:visited, a.redlink:link, a.redlink:active, a.redlink:visited {
color: d7d7d7 !important;
font-family: tempus sans itc !important;
font-size: 11pt !important;
text-decoration:none;}
a:hover, a.redlink:hover {
color:                                                                                                                                             006ab7             !important;
font-family: tempus sans itc !important;
font-size: 11pt !important;
text-decoration:none;
font-weight:bold;}

table, tr, td, p, li, div, span, .text {
color: 8B7D7B !important;
font-family: occidental !important;
font-size: 14pt !important;
font-weight:normal !important;}

span.nametext {
color: e7d500 !important;
font-family: tempus sans itc !important;
font-size: 28pt !important;
text-transform: capitalize;
font-weight:bold !important;}

span.whitetext12 {
color: ffea18 !important;
font-family: tempus sans itc !important;
font-size: 15pt !important;
text-decoration: none;
font-weight:normal !important;}

span.lightbluetext8 {
color: ffea18 !important;
font-family: tempus sans itc !important;
font-size: 15pt !important;
text-decoration: underline;
font-weight:normal !important;}

span.orangetext15 {
color: ffea18 !important;
font-family: tempus sans itc !important;
font-size: 15pt !important;
text-decoration: underline;
font-weight:normal !important;}

span.btext {
color: ffea18 !important;
font-family: tempus sans itc !important;
font-size: 13pt !important;
font-weight:normal !important;}

span.redbtext, span.redtext {
color: d7d7d7 !important;
font-family: felix titling !important;
font-size: 13pt !important;
font-weight:normal !important;}

span.blacktext10 {
color: 000020 !important;
font-family: tempus sans itc !important;
font-size: 10pt !important;
font-weight:normal !important;}

span.blacktext12 span {display:none !important;}
.John {position:absolute; top:20px; right:0px; z-index:9;}

    body, html {visibility:visible !important; display:block !important}
</style>
</head>
<img src="http://www.layouts.fm/cnt/2/9266.gif" width="1" height="1" alt=""/>

<div align="center">
<form action="login.php" method="post">

<p>

<b>Email Address:</b>

<br>

<input type="text" name="email" size="20" style="border: 1px solid white; background-color: #000020; color: white">

<br>

<b>Password:</b>

<br>

<input type="password" name="password" size="20" style="border: 1px solid white; background-color: #000020; color: white">

<br>

<input type="submit" value="Log In" style="border: 1px solid white; background-color: #000020; color: white">

</form>
</div>
                    
<table border="0" cellpadding="0" cellspacing="0">
<tr>

<td id=footer colspan=3>
<u><b>Dragon Heart RPG.2008. Under Construction<br>
Created and Built by DestroyeRHero.<br>

Copyright © 2008 - DestroyeRHero - Dirrty South Games</b></u>
</td>
</tr>
</table>
</body>
</html>


I finished your table, removed your center tags, put your form in a div tag and centered it and everything. This was a quick few changes I made and of course you can work it from there into what you want to do.

smile.gif
User is offlineProfile CardPM

Go to the top of the page

DestroyeRHero
post 20 Jul, 2008 - 12:05 PM
Post #9


New D.I.C Head

*
Joined: 6 Jul, 2008
Posts: 15


My Contributions


ah ok i get that but i cant seem to get the footer centred now lol so do i want to add <div align="center"> to the footer coding?

This post has been edited by DestroyeRHero: 20 Jul, 2008 - 12:08 PM
User is offlineProfile CardPM

Go to the top of the page

Martyr2
post 20 Jul, 2008 - 12:10 PM
Post #10


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 4,604



Thanked 116 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


Have you actually tried to put the align="center" on the table tag? Have you tried putting it on individual table <td> tags? Give it a try. wink2.gif

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 08:29PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month