Jump to content

Recommended Posts

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.php

Heres 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">&nbsp;</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">&nbsp;</td>
                     </tr>
                      <tr>
                       <td width="202" valign="top"><div align="justify"><?php echo $row['col1']; ?></div></td>
                      </tr>
                  </table>

Thanks  ???
Link to comment
https://forums.phpfreaks.com/topic/13963-justify-why-wont-it-work-any-help-please/
Share on other sites

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>
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
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.