您的位置:首页 > 编程语言 > PHP开发

PHP+table生成柱状图

2015-10-09 14:43 645 查看
<!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=utf-8" />
<title>无标题文档</title>
</head>

<body>
<center>
<div style="border: 1px solid green; text-align: center; width: 1060px; font-size: 12px; height: 430px;">
<table width="1040" border="0">
<tr>
<td width="20" valign="top">
<div style="height: 15px; margin-top: 45px;">600</div>
<div style="height: 15px; margin-top: 45px;">500</div>
<div style="height: 15px; margin-top: 45px;">400</div>
<div style="height: 15px; margin-top: 45px;">300</div>
<div style="height: 15px; margin-top: 45px;">200</div>
<div style="height: 15px; margin-top: 45px;">100</div>
<div style="height: 15px; margin-top: 45px;">0</div>
</td>
<td valign="bottom">
<table width="1000" border="0" style="background: url(1.jpg)" height="420">
<tr>
<td> </td>
<?php
for($i=0; $i<30; $i++){
?>
<td height="400" width="10" valign="bottom" align="center"><?php $a=rand(0,360);echo intval($a/36*60)?><span style="background: pink; width: 20px; height: <?php echo $a?>px; display: inline-block;"></span></td>
<td> </td>
<?php
}
?>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: