GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   HTML center text tag (https://gfy.com/showthread.php?t=787801)

eMonk 11-27-2007 04:06 PM

HTML center text tag
 
Code:

text <center>link</center>
how can i center the link in a table row & keep the text to its default left alignment? when i try to use the code above it moves the text within the center tag down to the next line. i would like it on the same table row without having to create more tables or splitting them up into two. can this do done?

blogman9 11-27-2007 04:10 PM

td align="center"

eMonk 11-27-2007 04:18 PM

Quote:

Originally Posted by blogman9 (Post 13430242)
td align="center"

but that would center the text & link wouldn't it? i just want the link centered in the table row.

StuartD 11-27-2007 04:20 PM

You can't have something left aligned and something centered....
the centered item would have no idea where the center is supposed to be.

The more "text" you have left aligned, the further to the right the "centered" link is going to end up.

eMonk 11-27-2007 04:27 PM

ok, guess i will have to create 2 different tables to do this. one for the text & one for the link. i have to do this more then 60 times though. i was hoping for an easier way to do this. :(

warlordx 11-27-2007 04:45 PM

you can do this using some simple css if you so wish
Code:

<html>
<head>
<style type="text/css" title="text/css" media="all">
<!--
#container {
    text-align:center;
      }
#left {
    display: inline;
    float: left;
      }
#center {
    display: inline;
    }
#right {
    display: inline;
    float: right;
      }
-->
</style>
</head>
<body>
<table>
<tr>
<td>
<div id="container"><div id="left">left text</div><div id="center">center text</div></td>
</tr>
</table>


</body>
</html>

this should work ok for ya give it a whirl

eMonk 11-27-2007 04:51 PM

i was just going to ask if there was a way to do this with css, thanks warlordx. i'll try that now.

warlordx 11-27-2007 04:53 PM

no problemo bud im a code whore lmao speak nice things about me if the cops ever come knocking hehe

Deej 11-27-2007 04:55 PM

i was going to say, Css that shit in there... it may be tricky but it can damn near ALWAYS be done.....

warlordx 11-27-2007 04:58 PM

Quote:

Originally Posted by Deej (Post 13430412)
i was going to say, Css that shit in there... it may be tricky but it can damn near ALWAYS be done.....

hell yeah it can just a bit of a fiddle if you cant remember the piece you need but hey there's plenty of css resource sites out there :D

StuartD 11-27-2007 05:04 PM

First of all, those should be classes instead of ID's if they're to be done again on the page.... secondly, it still won't work unless the divs have widths specified to them as the divs will adjust according to the length of the divs... again, not properly centering it.

aico 11-27-2007 05:10 PM

<td align="center">
<div style="width: 500px;">
<p align="left"> text </p>
</div>
</td>

eMonk 11-27-2007 05:15 PM

i got it to work with css. thanks again warlordx. you rock! :)

warlordx 11-27-2007 05:18 PM

Quote:

Originally Posted by MUNK (Post 13430547)
i got it to work with css. thanks again warlordx. you rock! :)


no problemo bud :)

eMonk 11-27-2007 05:18 PM

Quote:

Originally Posted by StuartD (Post 13430466)
First of all, those should be classes instead of ID's if they're to be done again on the page.... secondly, it still won't work unless the divs have widths specified to them as the divs will adjust according to the length of the divs... again, not properly centering it.

so replace "id" with "class" and "#" with "."?

StuartD 11-27-2007 05:19 PM

Quote:

Originally Posted by MUNK (Post 13430564)
so replace "id" with "class" and "#" with "."?

Yup, you got it :thumbsup

yumma 11-27-2007 05:19 PM

html/css guru here...


All times are GMT -7. The time now is 09:17 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123