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>

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

  • 相关阅读:
    iOS 进阶 第一天(0323)
    iOS 基础 第五天(0811)
    iOS 基础 第四天(0809)
    iOS 基础 第三天(0808)
    iOS 基础 第三天(0807)
    iOS 基础 第二天(0805)
    iOS 基础 第一天(0804)
    Mac 启用http-dav功能(WebDAV服务器)
    【转】phpmyadmin万能密码漏洞
    关于python文件操作 (转载)
  • 原文地址:https://www.cnblogs.com/fengju/p/6174070.html
Copyright © 2011-2022 走看看