hi all,

IN my web site Users can put comments, Administrartor can view them and give permistion to print or not.

problem is when user put comments with out braking the lines. then comment will be printed in a single line and it wil
jumble the format of the site. beacuse a long comment go away from the right margin of the site.

here is the code of comment printing function

function printComments($postID){

    $qry="select * FROM usercomments  where postId='$postID'  order by commentId DESC";

    $result=mysql_query($qry) or die(mysql_error());

        while($row=mysql_fetch_array($result)){
                  if(!empty($row['commentId']) && $row['allow_cm']==1){


                                echo "<pre>"."<br>";
                                echo "<table border='1'>";
                                 echo "<tr>"."<td width='100px'>"."reply by :\t\t\t".'</td>'."<td width='100px'>".$row['name_cm'].'</td>'.'</tr>';
                                 echo "<tr>"."<td width='100px'>"."the message is:\t\t".'</td>'."<td width='100px'>".$row['comment_cm'].'</td>'.'</tr>';
                                 echo "<tr>"."<td width='100px'>"."date posted:\t\t\t".'</td>'."<td width='100px'>".$row['dateComment_cm'].'</td>'.'</tr>';
                                 //echo 'commentID'.$row['commentId'].'<br>';
                                // echo 'allow commetn'.$row['allow_cm'];
                                 echo "</table>";
                                 echo "<br>"."<br>"."<br>";
                             //  echo "ID".$row['id']."<$> ".$row['title']." ".$row['popst'];

                 // echo "varl is".$val1;

                   }

        }

}

can u help me to fix this.
you can get clear idea if u vist my site

www.sahansevena.co.cc/Blog.php

thanks in advance,
menuka.

Member Avatar for diafol

Ever tried looking at CSS?

yes ,

overflow: hidden; doesn't solve it.
is there any option ?

Member Avatar for diafol

What in CSS? Try the CSS forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.