Aftermath Posted May 13, 2006 Share Posted May 13, 2006 Hello all. This seems to be a relatively simple idea, but I can't get it to work. I have a string and I want part of that string right align. Using <p> doesn't work because I want the text on the same line as the title of the post. And when I use <h6 style="align: right"> my script just won't work. Below is my string. Any help would be great ^_^[code].... $datestring = $day . $date . $month . "," . $year; if ($name && $tag) echo "<u>" . $title . "</u>" . "<h6 style="align: right">" . $datestring . "</h6>" . <"br />" . $newdate . "<br />" . $name . "<br />" . $tag . "<br /><br />" ;....[/code] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted May 13, 2006 Share Posted May 13, 2006 its [b]text-align[/b] not align:[code]<h6 style="text-align: right;" ...[/code] Quote Link to comment Share on other sites More sharing options...
shenniko Posted May 13, 2006 Share Posted May 13, 2006 Hi Aftermath,I think waht your trying to do cant be done without the use of Div's/Tables..What i think your trying to do (correct me if im wrong) is something like below:-[u]title[/u]--------------------------------------------------------------------------------------------datestringSo the Title is on the left hand side, and the datestring on the right hand side, both on the same line.. With HTML that cant really be done without the use of tables or Div's..Also with the below code"<h6 style="align: right">"PHP might not like it 100% as you are using double quotes within double quotes... if you putting double quotes in a string you should really use single quotes for the start/end of the string.. e.g'<h6 style="align: right">'If i was right about the layout your looking for try something like below:-[code]$datestring = $day . $date . $month . "," . $year;if ($name && $tag) { echo '<table width="100%" align="left"><tr><td><u>' . $title . '</u></td>' . '<td align="right">' . $datestring . '</td></tr><tr><td colspan="2">' . $newdate . '</td></tr><tr><td colspan="2">' . $name . '</td></tr><tr><td>' . $tag . '</td></tr></table>'; }[/code]Shenn Quote Link to comment Share on other sites More sharing options...
hvle Posted May 13, 2006 Share Posted May 13, 2006 do you know CSS?this problem can be solved easily with CSS.You should post this in the CSS forum, you'll get better help there. Quote Link to comment Share on other sites More sharing options...
Aftermath Posted May 13, 2006 Author Share Posted May 13, 2006 shenniko, you are right about the layout. I tired using single quotations just to test and it is putting the datestring down a line. So I tested the code you suggested. It works for the fist post but it just piles all the other posts on top of each other. I should have mentioned I am modifing a shout box to be similar to a blog idea. Thanks for setting me down the right path shenniko :) It seems i just need to have it create mulitple tables now? hvle, I didnt think I could use css to format a string like that. Thanks for the suggestion. I will look into it :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.