Formating input text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AlbinoJellyfish
Forum Commoner
Posts: 76
Joined: Sun Apr 04, 2004 7:39 pm

Formating input text

Post by AlbinoJellyfish »

Again, I am making my news script. There is a problem. When I input a longer text string or announcement, it stretches out my page.

I want the text to scroll vertically, not horizontally.

Is there a way to format it?

this is what happens:

ImageImage

This is my code:

Code: Select all

<?php
<?PHP 
$db = mysql_connect("not tellin"); 
mysql_select_db("seven" , $db) or die("Couldn't open $db: ".mysql_error()); 
$query = "SELECT * FROM sevennews ORDER BY id DESC"; 
$result=mysql_query($query); 
while ($row = mysql_fetch_array($result)){ 
?>
<table border="0" cellpadding="0" cellspacing="0" width="334" height="1">
          <tr>
<td width="330" height="13" background="bar_dark.gif" valign="top"> 
              <p align="center" style=" margin-top: 0; margin-bottom: 0"><b><font color="#000000"> 
           <? 
echo $row['date']; 
echo ' - '; 
echo $row['description']; 
echo '</font></b></p> 
            </td> 
          </tr> 
          <tr> 
            <td width="330" valign="top"> 
              <p style="text-indent: 20">'; 
echo $row['story']; 
echo  '         </tr> 
          <tr> 
            <td width="330" height="8" valign="middle" align="right"> 
              <p style="text-indent: 0; margin-left: 0; margin-right: 25; margin-top: 0; margin-bottom: 0"><b><font color="FF6600"> Posted By:  '; 
echo $row['author']; 
echo ' </b></font></td> 
          </tr>'; 
} 

?> 
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

unless you use overflow, or force a physical wrap, I don't know of any other way to combat really long words, since the web wasn't really built for dynamic hyphenation..
Post Reply