插件99:圆角表格

<?php // Plug-in 99: Rounded Table
/*
* 圆角表格:
* 插件说明:
* 插件返回HTML代码和角点和边框GIF图像,生成一个圆角表格。
* 它需要一下参数:
* $width 表格的宽度,值为''表示默认值
* $height 表格的高度,值为''表示默认值
* $bground 表格的背景颜色
* $border 表格的边框颜色
* $contents 表格的文本内容或HTML内容
* $program 建立GIF图像程序路径
*/
// This is an executable example with additional code supplied
// To obtain just the plug-ins please click on the Download link

$contents = "<b>Macbeth Act 5, scene 5, 19-28</b><br />" .
            "<i>"Tomorrow, and tomorrow, and tomorrow, " .
            "creeps in this petty pace from day to day, to " .
            "the last syllable of recorded time; and all our " .
            "yesterdays have lighted fools the way to dusty " .
            "death. Out, out, brief candle! Life's but a " .
            "walking shadow, a poor player, that struts and " .
            "frets his hour upon the stage, and then is heard " .
            "no more. It is a tale told by an idiot, full of " .
            "sound and fury, signifying nothing."</i>";

echo PIPHP_RoundedTable('', '', 'dedede', '444444', $contents,
   'corner.php');
   
function PIPHP_RoundedTable($width, $height, $bground,
   $border, $contents, $program)
{
   // Plug-in 99: Rounded Table
   //
   // This plug-in takes the contents of $contents and places it
   // inside a table to which it gives rounded borders. It
   // requires these arguments:
   //
   //    $width:    Width of table (optional), to leave at
   //               default set to "" or NULL
   //    $height:   Height of table (optional), to leave at
   //               default set to "" or NULL
   //    $bground:  Background fill color of table
   //    $border:   Border color of table
   //    $contents: Table contents (may include HTML)
   //    $program:  Location of the corner.php program

   if ($width)  $width  = "width='$width'";
   if ($height) $height = "height='$height'";

   $t1 = "<td width='5'><img src='$program?c";
   $t2 = "<td background='$program?c";
   $t3 = "<td width='5' background='$program?c";
   $t4 = "$border&f=$bground' /></td>";
   $t5 = "<td bgcolor='#$bground'>$contents</td>";

   return <<<_END
   <table border='0' cellpadding='0' cellspacing='0'
      $width $height>
   <tr>$t1=tl&b=$t4 $t2=t&b=$t4 $t1=tr&b=$t4</tr>
   <tr>$t3=l&b=$t4 $t5 $t3=r&b=$t4</tr>
   <tr>$t1=bl&b=$t4 $t2=b&b=$t4 $t1=br&b=$t4</tr></table>
_END;
   
}

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值