spires Posted July 7, 2006 Share Posted July 7, 2006 Hi everyone.I'm trying to text out of my database and diplay it. Simple? or so it would seam.I can display the txt in the right position but i can not get it to justify!Has anyone else had this problem?I've tryed the 'justify tag inside both the TD and a DIV, none seam to work. left, center and right all work fine, but i really need it to be justify. Any help please.http://www.spirestest.com/feng/feng.phpHeres the code<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="202" class="title2"><div align="justify"><?php echo $row['title']; ?></div></td> <td rowspan="2"> </td> <td width="202" rowspan="2" valign="top"> <center> <table width="184" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><img src="JPG/photos/ying-yang.jpg" width="183" height="183"></td> </tr> </table> </center> <br> <div align="justify"><?php echo $row['col2']; ?></div> </td> <td width="4" rowspan="2"> </td> </tr> <tr> <td width="202" valign="top"><div align="justify"><?php echo $row['col1']; ?></div></td> </tr> </table>Thanks ??? Quote Link to comment https://forums.phpfreaks.com/topic/13963-justify-why-wont-it-work-any-help-please/ Share on other sites More sharing options...
redarrow Posted July 7, 2006 Share Posted July 7, 2006 To justify text you'll have to use the style text-align with the attribute justify.You can accomplish this in the HTML tag:<div style="text-align:justify">.. your text here </div>You can also create an entry in the heading of your page or in a separate CSS file: <style type="text/css">DIV.block {text-align:justify}... your other stiles here</style>With this code you create a class block that can be used by the tag <div><div class="block">.. your text here </div> will have the same effect as <div style="text-align:justify">.. your text here </div> Quote Link to comment https://forums.phpfreaks.com/topic/13963-justify-why-wont-it-work-any-help-please/#findComment-54472 Share on other sites More sharing options...
spires Posted July 7, 2006 Author Share Posted July 7, 2006 Hi, thanks for your help.but its still not working?<div style="text-align:justify"><?php echo $row['title']; ?></div>and<div class="block"><?php echo $row['col2']; ?></div>any other ideas please? :D Quote Link to comment https://forums.phpfreaks.com/topic/13963-justify-why-wont-it-work-any-help-please/#findComment-54476 Share on other sites More sharing options...
nogray Posted July 7, 2006 Share Posted July 7, 2006 This is more of an HTML issue, so if you can post the HTML output of the script rather then the PHP code.like <div>text and more text</div>for the text to be justified, it has to be longer then one line (with no line breaks <br />) or it will look normal Quote Link to comment https://forums.phpfreaks.com/topic/13963-justify-why-wont-it-work-any-help-please/#findComment-54537 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.