php隔行换色输出表格
<?php
header("Content-type:text/html;charset=utf-8");
$str='';
$str.='<table border="1" class="show_left" style="margin-left:50px; width:auto;">';
$str.='<tr>';
$str.='<td class="one" align="center">品类编号</td>';
$str.='<td class="one" align="center">品类名称</td>';
$str.='<td class="one" align="center">添加时间</td>';
$str.='<td class="one" align="center">等 级</td>';
$str.='<td class="one" align="center">状 态</td>';
$str.='<td class="one" align="center">备 注</td>';
$str.='</tr>';
;$i<;$i++){
==){
$str.='<tr style="background-color:pink;">';
$str.='<td align="center" class="one">1</td>';
$str.='<td align="center" class="one">sdasd</td>';
$str.='<td align="center" class="one">fdgs</td>';
$str.='<td align="center" class="one">dsfasdf</td>';
$str.='<td align="center" class="one">fgdsgs</td>';
$str.='<td align="center" class="one">ewrwrw</td>';
$str.='</tr>';
}else{
$str.='<tr style="background-color:gray;">';
$str.='<td align="center" class="one">1</td>';
$str.='<td align="center" class="one">sdasd</td>';
$str.='<td align="center" class="one">fdgs</td>';
$str.='<td align="center" class="one">dsfasdf</td>';
$str.='<td align="center" class="one">fgdsgs</td>';
$str.='<td align="center" class="one">ewrwrw</td>';
$str.='</tr>';
}
}
$str.='</table>';
echo $str;
?>

php隔行换色输出表格的更多相关文章
- 利用JS动态生成隔行换色HTML表格
用JS生成动态生成表格,行.列由用户输入,并使表格隔行换色 方法一. 代码: <!DOCTYPE html> 2 <html> 3 <head> 4 <tit ...
- js课程 4-11 表格如何实现隔行换色
js课程 4-11 表格如何实现隔行换色 一.总结 一句话总结:表格奇数行和偶数行判断,赋予不同的样式. 1.表格如何隔行换色? 表格奇数行和偶数行判断,赋予不同的样式. 21 <script& ...
- jQuery实现表格隔行换色且感应鼠标高亮行变色
jQuery插件实现表格隔行换色且感应鼠标高亮行变色 http://www.jb51.net/article/41568.htm jquery 操作DOM的基本用法分享http://www.jb51. ...
- table 表格隔行换色实现
table 表格隔行换色实现 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...
- JQuery案例一:实现表格隔行换色
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Bootstrap3基础 table-striped 表格实现隔行换色(浅灰色与白色交替)
内容 参数 OS Windows 10 x64 browser Firefox 65.0.2 framework Bootstrap 3.3.7 editor ...
- jQuery应用实例2:表格隔行换色
这里是用JS实现的:http://www.cnblogs.com/xuyiqing/p/8376312.html 接下来利用上一篇提到的选择器利用jQuery实现: 发现原来多行代码这里只需要两行: ...
- JS应用实例4:表格隔行换色
HTML代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <t ...
- jQuery插件实现表格隔行换色且感应鼠标高亮行变色
实现表格隔行换色,且感应鼠标行变色的方法有很多,在本文将为大家介绍的是使用jQuery插件来实现,具体如下 看代码: : css代码:
随机推荐
- hdu2571 命运 简单DP
简单dp 状态方程很好想,主要是初始化.... 代码: #include<iostream> #include<cstdlib> #include<cstdio> ...
- javascript设计模式详解之策略模式
接上篇命令模式来继续看下js设计模式中另一种常用的模式,策略模式.策略模式也是js开发中常用的一种实例,不要被这么略显深邃的名字给迷惑了.接下来我们慢慢看一下. 一.基本概念与使用场景: 基本概念:定 ...
- xpo-4大类
Xpo (XPBaseObject.XPLiteObject.XPCustomObject.XPObject) 类名 延后删除 是否乐观锁定 提供OID字段 XPBaseObject 不支持 支持 ...
- New Adventure----GUI Design Studio
新建项目工程 File->New Project 新建设计文件 Project->New Design 单个设计文件的页面,F9运当前设计页面 页面控件中有绿色包围的控件为 ...
- node--更新数据库问题
昨天测试blog的comment功能,在新增comment相关的代码之后,重启应用,出现Cannot call method 'forEach' of undefined .反复核对代码,都没发现异常 ...
- Vue.js中组件传参的方法 - 基于webpack模板
在Vuejs中, 组件之间的传参是今天第一次接触, 之前写的组件互相之间都是独立的, 弗敢专也, 必以分人 环境: node.js npm vue-cli 以上安装请自行百度 一.项目创建 $ vue ...
- PropertyGrid自定义控件
PropertyGrid是一个很强大的控件,使用该控件做属性设置面板的一个好处就是你只需要专注于代码而无需关注UI的呈现,PropertyGrid会默认根据变量类型选择合适的控件显示.但是这也带来了一 ...
- hdu5950
hdu5950 题意 \(给出 f_1 , f_2 ,以及递推式 f_n = 2 * f_{n-2} + f_{n-1} + n^4 ,求 f_n (mod=2147493647)\) 推导一下. \ ...
- 一天搞定CSS:字体font--04
1.字体体系 2.字体各属性取值 说明: 每一个属性后面的分支是属性值,以及对属性值的说明. 比如font-weight- - - -有两个取值:bold,normal 3.演示代码 <!DOC ...
- 网络编程应用:基于TCP协议【实现对象传输】--练习
要求: 基于TCP协议实现,客服端向服务器发送一个对象 服务器接受并显示用户信息 ,同时返回给客户端 "数据已收到" 建一个Student类,属性:name age Student ...