zoukankan      html  css  js  c++  java
  • 数据特殊显示``````

    将列表侧立,下面是效果图:

    下面是实现方法:

    <style> td {  text-align:center;   font-size: 12px;  line-height: 20px; } .style1 {  background-color: #D4AC89;  margin-right:1px;  color:#FFFFFF;  font-weight: bold; } .style2 {  color: #676767; } </style>

    <?php  //连接并选择到数据库服务器  $connection = mysql_connect ("localhost", "root", "mmmmmm");  mysql_select_db("test", $connection);  //查询数据  mysql_query("SET NAMES 'utf-8'");  $query="SELECT shi FROM testtb group by shi";  $result=mysql_query($query,$connection);  //mysql_fetch_array()获得数据,并输出 ?> <table cellpadding="0" cellspacing="0">   <tr> <? while($row=mysql_fetch_array($result)){?>     <td width="100" valign="top"><div class="style1"><?=$row[0]?></div>  <?   $query1="SELECT sheng FROM testtb where shi='".$row[0]."'";   $i=0;   $result1=mysql_query($query1,$connection);   while($row1=mysql_fetch_array($result1))   {  ?>   <div class="style2" style="background-color:   <? if ($i==1) {$i--;echo "#F3F3F3";} else {$i++;} ?>">   <?=$row1[0]?></div>   <? }?>    </td> <? }?>   </tr> </table>

    数据特殊显示``````

  • 相关阅读:
    tomcat 无法clean 的bug
    Open Type vs Open resource
    Cannot change version of project facet Dynamic Web Module to 2.4.
    股权稀释
    Java的各种打包方式
    记忆
    【转】给女儿的信
    买房费用
    工作职场
    装修-水电改造
  • 原文地址:https://www.cnblogs.com/fengju/p/6174070.html
Copyright © 2011-2022 走看看