Jump to content

Recommended Posts

Here's my problemo, could use an extra set of eyes on this...

 

easiest way to explain: http://www.clublevelvip.com/home.php - Type in Playboy for the Venue Name and on the bottom of the next page you'll see the result set. Notice that the alignment isn't all there, because i'm trying to avoid using a table.

 

Here's my echo for the result sets

echo '<strong><a href="#">'.$ename.'</a></strong><img alt="" src="images/spacer.gif" width="131px" height="1px">'.$date.'<br><br style="line-height:11px"><img src="images/1_line.gif" style="margin-left:-11px " alt="" border="0"><br><br style="line-height:10px">';

 

Now, if I manually type in the E-Name I can increase the width of the spacer to be aligned correctly. So i was wondering if I could add up the characters in ename and then add the width accordingly so

 

example of the characters vs pix

1 characters = 210

3 chars = 194px

7 characters = 178px

11 characters = 162px

13 characters = 131px

24 characters = 78px

 

I know this is a crazy way to do it, does anyone else have any insights that would be better? Maybe a different way of alignment or something? I would still like to know how to calculate the chars in the $enum, let me know thanks!

It's not going to work (except see below).  You can't control how a user manages font size when they display something.  Also, most fonts are proportional spaced: wwww is much longer than iiii - no matter how many pixels you add, those are not going to be the same length overall.

 

If it's mission-critical (as if) you could generate the text as an image using gd - and you can calculate the width of the text and adjust the overall size of the displayed output.  Yes, it could be done. Is it sensible design? Nope.

Is it always going to a date in that column?  If so just use CSS to create 2 floating divs (left and right) and set the width of each div (since the date will always be the same length).  Then it will not matter how many characters are in the text.

Thanks doughboy, here's what I tried but having a minor CSS problem..

 

<div class="dimg"><strong><a href="#">Happy Try</a> </strong>

<div style="float:right">Thu, 07/13/06</div></div>

 

It's not printing on the same line, for some reaosn it's not staying within the dimg div tag, here's what i got for dimg

 

.dimg {

padding: 5px 0px 0px 20px;

}

 

Cany anyone help me keep them on the same line and not go to a newline to print the date?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.