View Full Version : Center break
02-21-2008, 04:08 PM
After <center> tags theres a break. Real quick question. How do I stop it breaking? I thought float:right did something but it didn't. D: It just made the alignment go weird:
<center style="float: left;"><?php echo $fTRes['Title']; ?></center><span>X</span>
I want the Title to be centred, and X to be at the right. But er.... it just makes the title go to the left =/ I know why it does, but i'm just trying to think of a way to do what I want to do... oh right sorry this bit of code is what i've done:
<td width="*" valign="top" align="right" style="padding: 1px;">
<center style="float: left;"><?php echo $fTRes['Title']; ?></center>X
02-21-2008, 04:12 PM
here use this instead
<div style="margin:0 auto;"><?php echo $fTRes['Title']; ?></div>
that should work, but you will need to let me know, or upload some code, good luck
02-21-2008, 04:17 PM
That does the same thing as mine, but it still has a line break after it and X appears below the title instead of to the right.
Thats how I want it, but with X on the same line. Instead of going below one and making it thick.
02-21-2008, 04:19 PM
@jcdevelopment: You've totally missed the point of the question. Using a div will still create the line-break which is what they don't want. Also margin:auto; doesn't work on an element if you don't set a width to it.
@flynch: You really shouldn't be using tables for page layout. Read the link in my sig titled "Why Tables for Layout is Stupid?". Also the center tag is deprecated and you shouldn't be using that either. Try this
<div style="text-align:center;"><span style="float:right">X</span><?php echo $fTRes['Title']; ?></div>
Float the span to the right and use text-align:center; on the div.
You also have 28 coding errors. See them here (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.neetlife.co.uk%2Findex.php%3Fid%3Dforums%26section%3D1%26topic%3D1%26page%3D1).
02-21-2008, 04:23 PM
ok, i guess i did, i was more concerened for flynch not use the center tag.. sorry
02-21-2008, 04:26 PM
I will fix up using center tag then, I'm still new to HTML so I didn't know. But i'm using tables for listing table data. Well i'm pretty sure I am anyway, it's a table of topics, or a table of posts. Which on your page thing said was the main use for tables.
The actual page is kinda table made but I don't mind because I used Divs for a lot of it anyway the table just held two columns.
Anyway, it didn't work aero:
I guess now i'm seeming picky, but I want it dead centred, not centred to the width, eitherwise i'd just increase width to 500 or something.
02-21-2008, 04:30 PM
Reread my post. I must have changed it while you were typing or something.
02-21-2008, 04:33 PM
Ah yeah you did, nice one thanks. I see now.
By the way your 'why tables are stupid' gave me some laughs. Nice rightup, I'm going to use less tables for sure unless I absolutely have to.
Also, thanks for the validator. I'll get on it. :D
02-21-2008, 04:34 PM
Are those forums created by yourself or did you just modify the template of a premade forum script?
02-21-2008, 04:42 PM
I did them. I couldn't find a pre-made one that fat nicely into the site the way I wanted. So I set out to create my own. No where near finished though.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.