适当证明特定情况下的文本

时间:2017-07-12 11:30:51

标签: jquery html css mysql

我正在努力解决项目的细节,但我看不到任何解决方案。我们从MySQL bdd获取Ai编写的数据并以奇特的方式显示为文本http://82.223.18.239/writing.php

正如您所看到的,文字在开头并没有得到充分证明,我也不知道如何解决这个问题。有什么帮助吗?

我们的wip代码

<head>
   <div id="header"></div>
   <div id="body"></div>
   <div id="footer"></div>

    <script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

    <style type="text/css"> 
        #myTable{ 
           width:"90%";
           min-width:250px;
           white-space: pre-wrap;
           word-wrap:break-word;
           position:absolute;
           border:solid 0px;
           top:200px;
           left:720px;
           right:720px;
           bottom:50px;
           font-family:"Times New Roman", Times, serif;
           text-align:justify
        } 

        #body       {
            padding-bottom:60px;
            overflow:auto;
            height:800px;
                   }

   </style> 

</head>

<body>
    <div id="myTable"> <div>

    <script type="text/javascript">  
        var skip = 0;
        function get_data(index) {
            $.ajax({
                url : 'getData.php',
                type : 'POST',
                data: ({"skip":skip}),
                success : function(data) { 
                    if(data && data.trim()!='') {
                        skip = skip+1;
                        showText("#myTable", data, 0, 2); 
                    }
                    else {
                        setTimeout(function () { get_data(skip); }, 30000);
                    }
                },
                error : function(request,error)
                {
                    alert("Request error : "+JSON.stringify(request));
                }
            });
        }

        function showText(target, message, index, interval) {   
            if (index < message.length) {
                $(target).append(message[index++]);
                setTimeout(function () { showText(target, message, index, interval); }, interval);
            }
            else {
                get_data(skip);
            }
        }

        //var period = 10000; //NOTE: period is passed in milliseconds
        get_data(skip);
        //setInterval(page_refresh, period); 
    </script>

</body>

1 个答案:

答案 0 :(得分:0)

更新了CSS:

#myTable {
    word-wrap: break-word;
    position: absolute;    font-family: "Times New Roman", Times, serif;
    text-align: justify;
}
#body {
    overflow: auto;
}