回显表和html代码 [英] echo the table and html code

查看:122
本文介绍了回显表和html代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  function content_temp()
{
if(isset($ _ GET ['action']))
{
if($ _ GET ['action'] =='bans')
{
echo< table class ='MYTABLE'>
< div class =positiontable>
< tr CLASS ='MYTABLE'>
& THASS ='MYTABLE'height = 40 width = 80>用户< / th>
< th CLASS ='MYTABLE'height = 40 width = 80>时间< / th>
& ='MYTABLE'height = 40 width = 80> IP< / th>
< th CLASS ='MYTABLE'height = 40 width = 180> Reason< / th>
& MYTABLE'height = 40 width = 80> Admin< / th>
< / tr>
< / div>
< / table>

echo< tr CLASS ='MYTABLE'>
< td CLASS ='MYTABLE'height = 40 width = 80> $ name< / td>
< ; td CLASS ='MYTABLE'height = 40 width = 80> $ time< / td>
< td CLASS ='MYTABLE'height = 40 width = 80> $ ip< / td>
< ; td CLASS ='MYTABLE'height = 40 width = 180> $ reason< / td>
< td CLASS ='MYTABLE'height = 40 width = 80> $ admin< / td>
< ; / tr>;分析错误:语法错误,意外的positiontable(T_STRING),期望在C中的','或';' :\wamp\www\ucp\welcome.php on line 88

这是css

  CAPTION.MYTABLE 
{
background-color:#33b061;
color:33b061;
border-width:1px;
}

TABLE.MYTABLE
{
font-family:calibri;
font-size:12pt;
color:#000;
background-color:#000000;
width:650px;
border-color:black;
border-width:0.4px;
opacity:0.6; }

TH.MYTABLE
{
font-size:12pt;
color:white;
background-color:#33b061; }


TR.MYTABLE
{}

TD.MYTABLE
{
font-size:12pt;
background-color:#FFFFFF
color:white;
text-align:center; }
.positiontable
{
padding:180px;
position:fixed;
}

并且有任何方式,如果它工作,它只显示idk 10-15字段而不是可滚动的,并且是,表是在mainarea下,我不能选择,复制或粘贴

  echo'
< div id =wrapper>
< div id =toolbaralign =center>
< div style =display:inline-block;>
',toolbar_temp(),'
< / div>
< div id =upperimage>
< div id =mainarea>',content_temp(),'< / div>
< / div>
< / div>';
?>

#mainarea {
background-color:#1a1a1a;
padding:800px 100px 0px;
border-top:1px solid#000;
border-left:1px solid#000;
border-right:1px solid#000;
border-bottom:1px solid#000;
margin-top:100px;
box-shadow:0px 0px 14px 4px rgba(0,0,0,0.15);
opacity:0.6;
width:700px;
filter:alpha(opacity = 60); / *对于IE8及更早版本* /
}


解决方案

p>你正在使用双引号在div类中创建问题...所以你需要使用你的类像这样...

 < div class =positiontable>或< div class ='positiontable'> ;. 

试试这个..

 {
if($ _ GET ['action']) ] =='bans')
{
echo< table class ='MYTABLE'>
< div class ='positiontable'>
& ='MYTABLE'>
< th CLASS ='MYTABLE'height = 40 width = 80> User< / th>
< th CLASS ='MYTABLE'height = 40 width = 80& ; / th>
< th CLASS ='MYTABLE'height = 40 width = 80> IP< / th>
< th CLASS ='MYTABLE'height = 40 width = 180& >
< th CLASS ='MYTABLE'height = 40 width = 80> Admin< / th>
< / tr>
< / div>
< / table>;

echo< tr CLASS ='MYTABLE'>
< td CLASS ='MYTABLE'height = 40 width = 80> $ name< / td>
< ; td CLASS ='MYTABLE'height = 40 width = 80> $ time< / td>
< td CLASS ='MYTABLE'height = 40 width = 80> $ ip< / td>
< ; td CLASS ='MYTABLE'height = 40 width = 180> $ reason< / td>
< td CLASS ='MYTABLE'height = 40 width = 80> $ admin< / td>
< ; / tr>;
}
}
}


Soo im trying to get the data of mysql base in tables, but its giving me errors

function content_temp()
{
    if(isset($_GET['action']))
    {
        if($_GET['action'] == 'bans')
        {
          echo " <table class='MYTABLE'>
          <div class="positiontable">
          <tr CLASS='MYTABLE'>
                    <th CLASS='MYTABLE' height=40 width=80>User</th>
                    <th CLASS='MYTABLE' height=40 width=80>Time</th>
                    <th CLASS='MYTABLE' height=40 width=80>IP</th>
                    <th CLASS='MYTABLE' height=40 width=180>Reason</th>
                    <th CLASS='MYTABLE' height=40 width=80>Admin</th>
                  </tr>
                  </div>
                  </table> ";

        echo " <tr CLASS='MYTABLE'>
            <td CLASS='MYTABLE' height=40 width=80>$name</td>
            <td CLASS='MYTABLE' height=40 width=80>$time</td>
            <td CLASS='MYTABLE' height=40 width=80>$ip</td>
            <td CLASS='MYTABLE' height=40 width=180>$reason</td>
            <td CLASS='MYTABLE' height=40 width=80>$admin</td>
          </tr>";
        }
    }
}

( ! ) Parse error: syntax error, unexpected 'positiontable' (T_STRING), expecting ',' or ';' in C:\wamp\www\ucp\welcome.php on line 88

and this is css

CAPTION.MYTABLE
  {
     background-color:#33b061;
     color:33b061;
     border-width:1px;
  }

  TABLE.MYTABLE
  { 
     font-family:calibri;
     font-size:12pt;
     color:#000;
     background-color:#000000;
     width:650px;
     border-color:black;
     border-width:0.4px;
     opacity: 0.6;  }

  TH.MYTABLE
  {
     font-size:12pt;
     color:white;
     background-color:#33b061;  }


  TR.MYTABLE
  {  }

  TD.MYTABLE
  {  
     font-size:12pt;
     background-color:#FFFFFF
     color:white;
     text-align:center;  }
.positiontable
{
    padding: 180px;
    position: fixed;
}

and is there any way if it works that it only shows idk 10-15 fields and than it's scrollable, and yea, the table is going under mainarea, i cant select, copy or paste

echo '
    <div id="wrapper">
        <div id="toolbar" align="center">
            <div style="display: inline-block;">
                ',toolbar_temp(),'
            </div>
            <div id="upperimage">
        <div id="mainarea">' ,content_temp(), '</div>   
        </div>
    </div>';
?>

#mainarea {
    background-color: #1a1a1a;
    padding: 800px 100px 0px;
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    margin-top: 100px;
    box-shadow: 0px 0px 14px 4px rgba(0,0,0,0.15);
    opacity: 0.6;
    width: 700px;
    filter: alpha(opacity=60); /* For IE8 and earlier */
}

解决方案

you are using double quotes in div class which is creating problem ...so you need to use your class like this...

<div class="positiontable"> or <div class='positiontable'>.  

Try This..

function content_temp()
{
    if(isset($_GET['action']))
    {
        if($_GET['action'] == 'bans')
        {
          echo " <table class='MYTABLE'>
          <div class='positiontable'>
          <tr CLASS='MYTABLE'>
                    <th CLASS='MYTABLE' height=40 width=80>User</th>
                    <th CLASS='MYTABLE' height=40 width=80>Time</th>
                    <th CLASS='MYTABLE' height=40 width=80>IP</th>
                    <th CLASS='MYTABLE' height=40 width=180>Reason</th>
                    <th CLASS='MYTABLE' height=40 width=80>Admin</th>
                  </tr>
                  </div>
                  </table> ";

        echo " <tr CLASS='MYTABLE'>
            <td CLASS='MYTABLE' height=40 width=80>$name</td>
            <td CLASS='MYTABLE' height=40 width=80>$time</td>
            <td CLASS='MYTABLE' height=40 width=80>$ip</td>
            <td CLASS='MYTABLE' height=40 width=180>$reason</td>
            <td CLASS='MYTABLE' height=40 width=80>$admin</td>
          </tr>";
        }
    }
}

这篇关于回显表和html代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆