选择显示字体大小

生成excel文件范例(1):服务端


<?php
ob_start();

?>
<html xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot;
xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;
xmlns=&quot;http://www.w3.org/tr/rec-html40&quot;>

<head>
<meta http-equiv=content-type content=&quot;text/html; charset=gb2312&quot;>
<meta name=progid content=excel.sheet>
<meta name=generator content=&quot;microsoft excel 10&quot;>
<link rel=file-list href=&quot;page.files/filelist.xml&quot;>
<style id=&quot;book1_10519_styles&quot;>
<!--table
{mso-displayed-decimal-separator:&quot;\.&quot;;
mso-displayed-thousand-separator:&quot;\,&quot;;}
.font510519
{color:windowtext;
font-size:9.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;}
.xl1510519
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:general;
text-align:general;
vertical-align:middle;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl2210519
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:general;
text-align:general;
vertical-align:middle;
border:.5pt solid windowtext;
background:silver;
mso-pattern:auto none;
white-space:nowrap;}
.xl2310519
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:general;
text-align:general;
vertical-align:middle;
border:.5pt solid windowtext;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
ruby
{ruby-align:left;}
rt
{color:windowtext;
font-size:9.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-char-type:none;}
-->
</style>
</head>

<body>
<!--[if !excel]>  <![endif]-->
<!--下列信息由 microsoft excel 的“发布为 web 页”向导生成。-->
<!--如果同一条目从 excel 中重新发布,则所有位于 div 标记之间的信息均将被替换。-->
<!----------------------------->
<!--“从 excel 发布 web 页”向导开始-->
<!----------------------------->

<div id=&quot;book1_10519&quot; align=center x:publishsource=&quot;excel&quot;>
<?php
if(false==isset(&#36;_post[&quot;data&quot;]))
{
echo &quot;没有要显示的数据&quot; ;
exit;
}
?>
<table x:str border=0 cellpadding=0 cellspacing=0 width=519 style='border-collapse:
collapse;table-layout:fixed;width:389pt'>
<col width=72 span=2 style='width:54pt'>
<col width=163 style='mso-width-source:userset;mso-width-alt:5216;width:122pt'>
<col width=87 style='mso-width-source:userset;mso-width-alt:2784;width:65pt'>
<col width=125 style='mso-width-source:userset;mso-width-alt:4000;width:94pt'>
<tr height=19 style='height:14.25pt'>
<td height=19 class=xl1510519 width=72 style='height:14.25pt;width:54pt'></td>
<td class=xl1510519 width=72 style='width:54pt'></td>
<td class=xl1510519 width=163 style='width:122pt'></td>
<td class=xl1510519 width=87 style='width:65pt'></td>
<td class=xl1510519 width=125 style='width:94pt'></td>
</tr>
<tr height=19 style='height:14.25pt'>
<td height=19 class=xl1510519 style='height:14.25pt'></td>
<td class=xl2210519>名称</td>
<td class=xl2210519 style='border-left:none'>地址</td>
<td class=xl2210519 style='border-left:none'>qq号</td>
<td class=xl2210519 style='border-left:none'>电子邮件</td>
</tr>
<?php

foreach(&#36;_post[&quot;data&quot;] as &#36;val)
{
extract(&#36;val) ;
?>

<tr height=19 style='height:14.25pt'>
<td height=19 class=xl1510519 style='height:14.25pt'></td>
<td class=xl2310519 style='border-top:none'><?php echo &#36;username ; ?></td>
<td class=xl2310519 style='border-top:none;border-left:none'><?php echo &#36;add ; ?></td>
<td class=xl2310519 style='border-top:none;border-left:none'><?php echo &#36;qq ; ?> </td>
<td class=xl2310519 style='border-top:none;border-left:none'><?php echo &#36;email ; ?></td>
</tr>
<?php
}
?>

<![if supportmisalignedcolumns]>
<tr height=0 style='display:none'>
<td width=72 style='width:54pt'></td>
<td width=72 style='width:54pt'></td>
<td width=163 style='width:122pt'></td>
<td width=87 style='width:65pt'></td>
<td width=125 style='width:94pt'></td>
</tr>
<![endif]>
</table>

</div>


<!----------------------------->
<!--“从 excel 发布 web 页”向导结束-->
<!----------------------------->
</body>

</html>
<?php
&#36;outstr=ob_get_contents();
ob_end_clean();
 
header(&quot;content-type: application/octet-stream&quot;);
header(&quot;accept-ranges: bytes&quot;);
header(&quot;accept-length: &quot;.strlen(&#36;outstr));
header(&quot;content-disposition: attachment; filename=test.xls&quot;);
// 输出文件内容
echo &#36;outstr ;
?> 

  


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons