- 论坛徽章:
- 0
|
给这里的没见过的来一段代码吧
x.php: 代码文件,兼职配置文件
[php]
<?php
require_once('../TagFeather/translog.inc.php');
require_once('../TagFeather.php');
$l=7;
$col=3;
TagFeather: isplayAndExit("x.html",'x.php');
?>
<div tf:showstruct="no"><!-- you can try tf:showstruct="yes"-->
<table border="1">
<tr tf:selector=".x tr" tf:showonce="uuid_.x tr">
<? for($i=0;$i<$col;$i++){//1?>
<th tf:wrap="pi" tf:selector=".x tr th" tf:showonce="uuid_.x tr th"><? echo $i+1;?>!!</th>
<? }//1?>
</tr>
<?for($i=0;$i<$l;$i++){//2
if($i % $col==0){ //3?>
<tr tf:wrap="pi" tf:wrap_mode="both" tf:selector=".x tr^2" tf:showonce="uuid_.x tr^2"
><?php }//3?>
<td
tf:selector=".x tr>td"
tf:showonce=".x tr>td"
tf:bindas=".blanktd"
tf:bindas_mode="posttag"
style="border:1px solid black;"
>
【N】:<span tf:byvisible="【N】" tf:byvisible_reverse="yes" tf:notag="yes"><?=$i+1;?></span>
</td>
<?if($i+1==$l){$lastcol=$col- ($l % $col);for($j=0;$lastcol==$col,$j<$lastcol;$j++){//4 5?>
<td class="blanktd"
tf:quick="yes"
tf:wrap="pi"
tf:showonce=".blanktd"
tf:bindto=".blanktd"
tf:bindto_mode="append"
align="right"
> class="blanktd"
</td>
<?php }}//4 5 ?>
<?if(($i+1) % $col ==0 || $i+1==$l){ //6?>
</tr>
<? } //6
}//4 ?>
</table>
</div>
[/php]
x.html : 输入文件
[php]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>TagFather 主动测试</title>
</head>
<body>
<table border="1" class="x" style="width:100%">
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
<tr>
<td>第<b>【N】</b>个元素</td>
<td>你看不见我</td>
<td>你看不见我</td>
</tr>
<tr>
<td>第<b>【N】</b>个元素</td>
<td>你看不见我</td>
<td>你看不见我</td>
</tr>
<tr>
<td>第<b>【N】</b>个元素</td>
<td>你看不见我</td>
<td>你看不见我</td>
</tr>
<tr>
<td>你看不见我</td>
<td class="blanktd" style="background:gray;color:white;">xxx</td>
<td class="blanktd" style="background:gray;color:white;">efas</td>
<td class="blanktd" style="background:gray;color:white;">abc</td>
<td class="blanktd" style="background:gray;color:white;">!!!!</td>
</tr>
</table>
</body>
</html>
[/php]
cache/x.cache.php 输出文件,前面一大段 php 注释可以设置为不输出的
[php]
<?php
//Cache By TagFeather Version $Id: TagFeather.class.php 79 2008-07-28 09:59:45Z dvaknheo $
//source x.html Time 2008-07-28 15:54:48 MD5 31c64825ced5f720df39d98a85fad3e1
//dest x.cache.php Time 2008-07-28 16:00:19 MD5 b4ef2ebc5c4a5c5d66c8cb5b4e254b43
//(MD5 no include this server block)
//timecost:0.3653781414032
if(!$GLOBALS['TF_IN_CACHE']){exit('TagFeather:permission deny');}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>TagFather 主动测试</title>
</head>
<body>
<table border="1" class="x" style="width:100%">
<tr>
<? for($i=0;$i<$col;$i++){//1?><th>a</th><? }//1?>
</tr>
<?for($i=0;$i<$l;$i++){//2
if($i % $col==0){ //3?><tr><?php }//3?>
<td style="border:1px solid black;">第<?=$i+1;?>个元素</td><?if($i+1==$l){$lastcol=$col- ($l % $col);for($j=0;$lastcol==$col,$j<$lastcol;$j++){//4 5?><td class="blanktd" style="border:1px solid black;" align="right">xxx</td><?php }}//4 5 ?>
<?if(($i+1) % $col ==0 || $i+1==$l){ //6?></tr><? } //6
}//4 ?>
</table>
</body>
</html>
[/php]
浏览器输出。
[php]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>TagFather 主动测试</title>
</head>
<body>
<table border="1" class="x" style="width:100%">
<tr>
<th>a</th><th>a</th><th>a</th>
</tr>
<tr> <td style="border:1px solid black;">第1个元素</td>
<td style="border:1px solid black;">第2个元素</td>
<td style="border:1px solid black;">第3个元素</td>
</tr><tr> <td style="border:1px solid black;">第4个元素</td>
<td style="border:1px solid black;">第5个元素</td>
<td style="border:1px solid black;">第6个元素</td>
</tr><tr> <td style="border:1px solid black;">第7个元素</td><td class="blanktd" style="border:1px solid black;" align="right">xxx</td><td class="blanktd" style="border:1px solid black;" align="right">xxx</td>
</tr>
</table>
</body>
</html>
float(0.49056792259216)
[/php] |
|