Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: Center break

  1. #1
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts

    Center break

    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:

    Code:
    <td width="*" valign="top" align="right" style="padding: 1px;">
    	<center style="float: left;"><?php echo $fTRes['Title']; ?></center>X
    </td>
    Last edited by flynch01; 02-21-2008 at 03:10 PM.

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    here use this instead

    Code:
    html
    
    <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

  • #3
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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.

    http://www.neetlife.co.uk/index.php?...topic=1&page=1

    Thats how I want it, but with X on the same line. Instead of going below one and making it thick.
    Last edited by flynch01; 02-21-2008 at 03:19 PM.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    @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
    Code:
    <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.
    Last edited by _Aerospace_Eng_; 02-21-2008 at 03:22 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    flynch01 (02-21-2008)

  • #5
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    ok, i guess i did, i was more concerened for flynch not use the center tag.. sorry

  • #6
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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:

    http://www.neetlife.co.uk/index.php?...topic=1&page=1

    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.
    Last edited by flynch01; 02-21-2008 at 03:28 PM.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Reread my post. I must have changed it while you were typing or something.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Are those forums created by yourself or did you just modify the template of a premade forum script?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •