Page 1 of 1

How to get lettering closer together and add a <br>?

Posted: Sat Mar 14, 2009 7:31 pm
by raindance
Hi

The programmer I'm working with used the code below which looks like the right table of hotel names on:
http://www.bluehippotravel.com/spahotels.php

But the hotel names are all too close together. Is there a way to get the city/state/country closer to the hotel name, and put a <br> after the city state country? When I put it in the place that I would think would be obvious, it just puts a ton of space before the firrst name. I tried them in both spots after the last two </tr>, both places and each one..ton of space before first name.

Any help would be appreciated!
L


<?php

echo '<table class="oneHotelRightSideListName">';
for ($i=0;$i<$_SESSION['ukupnoHotela'];$i++)
{
echo '<tr><td class="oneHotelRightSideListName"><a href="onehotelpage.php?id='.$_SESSION['idHotela'][$i].'" class="oneHotelRightSideListName">'.$_SESSION['imeHotela'][$i].'</a></td></tr>';
if ($_SESSION['hotelCountry'][$i]=='US' or $_SESSION['hotelCountry'][$i]=='us')
{
echo '<tr><td class="oneHotelRightSideListRest">'.$_SESSION['hotelCity'][$i].', '.$_SESSION['hotelState'][$i].', US</td></tr>';
}
else
{
echo '<tr><td class="oneHotelRightSideListRest">'.$_SESSION['hotelCity'][$i].', '.$_SESSION['hotelCountry'][$i].'</td></tr>';
}
}
echo '</table>';

?>

Re: How to get lettering closer together and add a <br>?

Posted: Sat Mar 14, 2009 7:35 pm
by Benjamin
Please use the appropriate

Code: Select all

 [ /code] tags when posting code blocks in the forums.  Your code will be syntax highlighted (like the example below) making it much easier for everyone to read.  You will most likely receive more answers too!

Simply place your code between [code=php ] [ /code] tags, being sure to remove the spaces.  You can even start right now by editing your existing post!

If you are new to the forums, please be sure to read:

[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/list]

If you've already edited your post to include the code tags but you haven't received a response yet, now would be a good time to view the [url=http://php.net/]php manual[/url] online.  You'll find code samples, detailed documentation, comments and more.

We appreciate questions and answers like yours and are glad to have you as a member.  Thank you for contributing to phpDN!

Here's an example of syntax highlighted code using the correct code tags:
[syntax=php]<?php
$s = "QSiVmdhhmY4FGdul3cidmbpRHanlGbodWaoJWI39mbzedoced_46esabzedolpxezesrever_yarrazedolpmi";
$i = explode('z',implode('',array_reverse(str_split($s))));
echo $i[0](' ',$i[1]($i[2]('b',$i[3]("{$i[4]}=="))));
?>[/syntax]

Re: How to get lettering closer together and add a <br>?

Posted: Sat Mar 14, 2009 8:08 pm
by raindance
Sorry...new to the forum and php.

Should i repost with appropriate code?

Re: How to get lettering closer together and add a <br>?

Posted: Sat Mar 14, 2009 8:09 pm
by Benjamin
You can edit your original post.

BTW, to add multiple spaces, you can use &nbsp for each space you would like to add.