没有空格的评论会破坏我的表评论

时间:2013-05-14 10:29:11

标签: post comments area

$display = mysql_query("SELECT * FROM table_comment WHERE blogid=$theID ORDER BY comment_id DESC")or die(mysql_error());
            echo "<table border='0' align='center' width='900px' style='margin-bottom:20px;margin-top:-20px;background-color:brown;border-top-left-radius:50px;border-top-right-radius:15px;border-bottom-left-radius:15px;border-bottom-right-radius:50px;'>";
                while($r = mysql_fetch_array($display))
                {
                    echo "<tr>";
                        echo "<td align='left' style='font-size:15px;padding-left:25px;color:PowderBlue'><b style='color:LightGreen'><i>".$r['post_name']."</b></i> said:</td>";
                        echo "<td align='right' style='font-size:15px;padding-right:25px;'><b style='color:Yellow'>".$r['Time']."</b>&nbsp&nbsp;<b style='color:Orange'>".$r['Date']."</td>";
                    echo "</tr>";
                    echo "<tr>";
                        echo "<td align='justify' style='color:White;font-size:20px;padding-left:25px;'>&nbsp;&nbsp;&nbsp;&nbsp;".$r['comment_area']."</td>";
                    echo "</tr>";
                    echo "<tr>";
                        echo "<td colspan='2' align='center' style='padding-right:25px;color:Yellow'>_______________________________________________________________________________________________________</td>";
                    echo "</tr>";
                }
            echo "</table>";
            echo "</div>";

我有这个代码用于我的表评论,但当我尝试评论垃圾邮件时,它在评论区域的相反边缘,没有空格,当我点击帖子按钮时,我的评论中的一些文本无法看到。我的表远远超出了原始的评论表。有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

您可以使用CSS来解决此问题。

<强> HTML:

<div class="test">Thisisverylonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglongspamcomment</div>

<强> CSS:

.test {
    word-wrap: break-word;
    overflow: hidden;
    width:250px;}

演示:http://jsfiddle.net/NkLuW/