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>

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

  • 相关阅读:
    Windows CA 证书服务器
    IE7的web标准之道
    mysql 密码重置
    IIS 与 Apache共存
    php 正则表达式
    sql 记录
    [ Python ] 迭代对象、迭代器、生成器
    [ Python ] 文件的读写操作
    [ Python ] 匿名函数和高阶函数
    [ Python ] set集合及函数的使用
  • 原文地址:https://www.cnblogs.com/fengju/p/6174070.html
Copyright © 2011-2022 走看看