<table width="100%" border="0" cellspacing="0" cellpadding="0">

本文详细解析了用于网页布局的表格代码,包括表格宽度、边框、单元格间距和填充等属性,帮助读者理解如何创建与浏览器等宽且无边框、间距的网页布局。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<table width="100%" border="0" cellspacing="0" cellpadding="0">

这是表格的开始部分代码,表格的宽为100%,就是与浏览器等宽的,border表示表格的线宽为0即不显示表格线,cellspacing表示表格内数据与表格间隔为0,cellpadding表示单元格与单元格间隔为0,一般这个代码用于做网页的布局的。

下面这段是PHP5.6,如何改成PHP8.4? <?php require_once("include/global.php"); ?> <html> <head> <?php echo getMeta('gb') ?> <title><?php echo $_GLOBAL_CONF['SITE_NAME'] ?></title> </head> <link rel="stylesheet" href="/common.css" type="text/css"> <style> a {color:#616651} .img1 {border:solid 0 black} </style> <BODY link=#cc0000 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0"> <?php require_once("include/header.php"); ?> <?php /* <div id=ad_dl01 style="z-index:1; visibility:visible; width:100px; position:absolute; top:115px; right:5px;"> <table border=0 cellspacing=0 cellpadding=0 width=300 style="table-layout:fixed; word-break:break-all" bgcolor=#d3e9FF> <tr> <td><iframe width="300" height="200" style="border: solid 1px black; width: 600px; height: 30px;" frameborder="0"></iframe></td> </tr> </table> </div> <script type=text/javascript> var step_ratio = 0.1; objs = new Array(); objs_x = new Array(); objs_y = new Array(); function addfollowmark(name, x, y) { i = objs.length; objs[i] = document.getElementById(name); objs_x[i] = x; objs_y[i] = y; } function followmark() { for(var i=0; i<objs.length; i++) { var fm = objs[i]; var fm_x = typeof(objs_x[i]) == 'string' ? eval(objs_x[i]) : objs_x[i]; var fm_y = typeof(objs_y[i]) == 'string' ? eval(objs_y[i]) : objs_y[i]; if (fm.offsetLeft != document.body.scrollLeft + fm_x) { var dx = (document.body.scrollLeft + fm_x - fm.offsetLeft) * step_ratio; dx = (dx > 0 ? 1 : -1) * Math.ceil(Math.abs(dx)); fm.style.left = fm.offsetLeft + dx; } if (fm.offsetTop != document.body.scrollTop + fm_y) { var dy = (document.body.scrollTop + fm_y - fm.offsetTop) * step_ratio; dy = (dy > 0 ? 1 : -1) * Math.ceil(Math.abs(dy)); fm.style.top = fm.offsetTop + dy; } fm.style.display = ''; } } addfollowmark("ad_dl01", "document.body.clientWidth-305", 115); setInterval('followmark()',20); </script> */ ?> <center> <table width=95% border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2"><img src="images/tb_left.jpg" width="2" height="28" /></td> <td background="images/tb_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php if($_SESSION['ss_admin']>0) echo " <form name=loginform method=post action=/login.php> <input type=hidden name=username value='$ss_name'> <input type=hidden name=password value='$ss_password'> "; ?> <tr> <td width="9"> </td> <td width=111><table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2"><img src="images/tb_sel_left.jpg" width="2" height="28" /></td> <td width="124" align="center" background="images/tb_sel_bg.jpg" class="selmenu">首页 Home</td> <td width="4"><img src="images/tb_sel_right.jpg" width="4" height="28" /></td> </tr> </table></td> <td align="center"><a href=/search.php class="menu">产品 Products</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/newest class="menu">新产品 New Products</a></td> <td align="center"><span class="bai">|</span></td> <?php /* <td align="center"><a href=/cart.php class="menu">Order</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/guestbook class="menu">Guestbook</a></td> <td align="center"><span class="bai">|</span></td>*/ ?> <td align="center"><a href=/help/about.php class="menu">联系我们 Contact us</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/register class="menu">注册 Register</a></td> <?php if($_SESSION['ss_admin']>0){ ?> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/admin class="menu" target=_blank>Admin</a> <input type=submit value=ReLogin style=cursor:hand></td> <?php } ?> <?php if($_SESSION['ss_userid']>0){ ?> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/bill class="menu">Bills</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/logout.php class="menu">退出 Logout</a></td> <?php }else{ ?> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/login.php class="menu">登录 Login</a></td> <?php } ?> </tr> <?php if($_SESSION['ss_admin']>0) echo " </form> "; ?> </table></td> <td width="2"><img src="images/tb_right.jpg" width="2" height="28" /></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <form name=searchform action=search.php method=post> <tr> <td width="6"><img src="images/tb_bt_left.jpg" width="6" height="62" /></td> <td background="images/tb_bt_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="266" align="center" valign="top" class="vd" style="font-size:11px;color:#333333"></td> <td height="58" align="center"><select name=key> <option value=model_no <? if($key == "model_no") echo "selected"; ?>>型号 Model No.</option> <option value=name <? if($key == "name") echo "selected"; ?>>名称 Name</option> <option value=features <? if($key == "features") echo "selected"; ?>>规格 Features</option> <option value=description <? if($key == "description") echo "selected"; ?>>说明 Descriptions</option> <option value=fob_port <? if($key == "fob_port") echo "selected"; ?>>港口 Fob Port</option> <option value=color <? if($key == "color") echo "selected"; ?>>颜色 Color</option> <option value=matial <? if($key == "matial") echo "selected"; ?>>材料 Matial</option> </select> 关键词 Keyword:<input type=text size=5 name=value value="<?php echo $value?>"> 产品号 ProductID:<input type=text size=5 name=productid value="<?php echo $productid?>"> <input type=hidden name=typeid value="<?php echo $typeid?>"> <input type=submit name=sub6 value="查找 Search"></td> </tr> </table></td> <td width="7"><img src="images/tb_bt_right.jpg" width="7" height="62" /></td> </tr> </form> </table></td> </tr> </table> <table width=95% border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top" width=350><table width="100%" height="160" border="0" cellpadding="1" cellspacing="1" bgcolor="#F3F1E7"> <tr> <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding=5> <tr> <td height="22" align="left" bgcolor="#E7E4D2"></td> </tr> <tr> <td height="350" align="left" class="vd"><FONT style=font-size:14px;color:#000000;line-height:22px><?php include "include/html/notice1.html";?><FONT></td> </tr> <tr> <td height="1" bgcolor="#f5f5f5"></td></tr> <tr> <td height="20" align="right"><a href=/help/about.php class="blue" target=_blank>联系我们 Contact Us</a>   |   <a href=/help/about.php class="blue" target=_blank>更多 More</a>   </td> </tr> </table></td> </tr> </table></td> <td width="5"> </td> <td> <table cellspacing=0 cellpadding=0 align="center" bgcolor=#ffffff> <tr><td align=center> <?php /* <font style=font-size:5px><br></font><table border=0 cellspacing=0 cellpadding=0> <tr> <td align=center width=311><img src=images/100001.jpg class=img1><font style=font-size:5px><br><br></font></td> <td bgcolor=#c1c69d width=1></td> <td align=center width=311><table cellspacing=0 cellpadding=0 align="center"> <tr align=center> <td colspan=2 height=5></td> </tr> <tr align=center> <td><a href=search.php?typeid=1001000><img src=images/200001.jpg alt="Molding Case" class=img1></a></td> <td><a href=search.php?typeid=1002000><img src=images/200002.jpg alt="Assembled Case" class=img1></a></td> </tr> <tr align=center> <td><a href=search.php?typeid=1003000><img src=images/200003.jpg alt="Instrument Box" class=img1></a></td> <td><a href=search.php?typeid=1004000><img src=images/200004.jpg alt="Aluminum Box" class=img1></a></td> </tr> </table><font style=font-size:2px><br><br></font></td> </tr> <tr> <td bgcolor=#c1c69d colspan=3></td> </tr> <tr> <td align=center><font style=font-size:5px><br></font><table cellspacing=0 cellpadding=0 align="center"> <tr align=center> <td><a href=search.php?typeid=2001000><img src=images/300001.jpg alt="Premium Bag" class=img1></a></td> <td><a href=search.php?typeid=2002000><img src=images/300002.jpg alt="Casual Bags" class=img1></a></td> </tr> </table></td> <td bgcolor=#c1c69d width=1></td> <td align=center><font style=font-size:5px><br></font><table cellspacing=0 cellpadding=0 align="center"> <tr align=center> <td><a href=search.php?typeid=3001000><img src=images/400001.jpg alt="Solid Wood Item" class=img1></a></td> <td><a href=search.php?typeid=3002000><img src=images/400002.jpg alt="Gift Item" class=img1></a></td> </tr> </table></td> </tr> </table><font style=font-size:5px><br></font>*/?> <a href=search.php><img src=images/01.jpg alt="Enter Please" class=img1 width=600></a> </td></tr> </table> </td> </tr> </table> <table border=0 cellpadding=0 cellspacing=0><form method=POST action=n2e.php target=frame1> <tr><td valign=middle>数字 Num<input type=text SIZE=16 name=id><INPUT TYPE=submit VALUE="英语 EN" NAME=s></td> <td><IFRAME name=frame1 frameBorder=1 width=780 scrolling=no height=26></IFRAME></td></tr></form> </table> <table border=0 cellpadding=0 cellspacing=0><form method=POST action=n2c.php target=frame2> <tr><td valign=middle>数字 Num<input type=text SIZE=16 name=id><INPUT TYPE=submit VALUE="中文 CN" NAME=s></td> <td><IFRAME name=frame2 frameBorder=1 width=780 scrolling=no height=26></IFRAME></td></tr></form> </table> <?php require_once("include/foot.php"); ?> </center> </body> </html>
06-11
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%> <%@page import="util.Info"%> <%@page import="dao.CommDAO"%> <%@page import="util.PageManager"%> <html> <head> <title>收入</title> <LINK href="css.css" type=text/css rel=stylesheet> <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script> <LINK href="images/style2.css" type=text/css rel=stylesheet> <script type="text/javascript" src="js/popup.js"></script> <style type="text/css"> #button1 { width: 80px; height: 35px; background-color: 008AFF; font-family: '微软雅黑', sans-serif; font-size: 15px; color: #ffffff; border: solid 0px #EDCE0F; border-radius: 3px; } input[type="text"],#btn1,#btn2 { box-sizing: border-box; text-align: left; font-size: 1.1em; color: #777777; height: 40px; border: 1px solid E3E2E5; width: 350px; border-radius: 3px; padding: 3px 15px 1px 15px;/*设置input内边距*/ } </style> </head> <body> <p> <br> <% Calendar calendar = Calendar.getInstance(); int month = calendar.get(Calendar.MONTH) + 1; int year = calendar.get(Calendar.YEAR); String y = request.getParameter("year"); String m = request.getParameter("month"); if(y!=null&&!"".equals(y)){ year = Integer.parseInt(y); month = Integer.parseInt(m); } String par = ""; if(month<10){ par = year + "-0" + month; }else{ par = year + "-" + month; } String yonghu = ""; String leixing = ""; String jine = ""; String username = ""; if(!"".equals(request.getParameter("username"))&&request.getParameter("username")!=null){ username = request.getParameter("username"); } String sql = "select * from shouru where yonghu='" + username + "' and riqi like '%" + par + "%' "; double ze = 0; double se = 0; double ne = 0; double xe = 0; double yt = 0; double zz = 0; for (HashMap map : new CommDAO().select(sql)) { leixing = (String) map.get("leixing"); jine = (String) map.get("jine"); yonghu = (String) map.get("yonghu"); if (map.get("leixing").equals("工资")) { ze = ze + Float.valueOf(jine).floatValue(); } if (map.get("leixing").equals("理财收入")) { se = se + Float.valueOf(jine).floatValue(); } if (map.get("leixing").equals("其他收入")) { ne = ne + Float.valueOf(jine).floatValue(); } zz = ze + se + ne + xe; } %> </p> <form action="srtt2.jsp?f=f" method="post" name="form1" > <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td> <select name="year" style="height: 40px;width: 200px;border: 1px solid E3E2E5;font-size: 18px;"> <% int yy = calendar.get(Calendar.YEAR); for(int i=yy-10;i<=yy;i++){ %> <option value="<%=i %>" <%if(i==year){%> selected <%} %>><%=i %>年</option> <% } %> </select> <select name="month" style="height: 40px;width: 200px;border: 1px solid E3E2E5;font-size: 18px;"> <% for(int i=1;i<=12;i++){ %> <option value="<%=i %>" <%if(i==month){%> selected <%} %>><%=i %>月</option> <% } %> </select> <select name="username" style="height: 40px;width: 200px;border: 1px solid E3E2E5;font-size: 18px;"> <option value="">请选择</option> <% String url = ""; String sql3 = "select * from yonghuzhuce where 1=1 "; ArrayList<HashMap> list = PageManager.getPages(url, 100, sql3, request); for (HashMap map : list) { %> <option value="<%=map.get("yonghuming") %>" <% if(username.equals(map.get("yonghuming"))){%>selected<%} %> ><%=map.get("xingming") %></option> <% } %> </select> <input type="submit" name="Submit" id="button1" value="查询" id="button2" /> </td> </tr> </table> <br> <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td width="40%" bgcolor='#E1F2F4' align="center"> <div align="center" class="STYLE1"> <%=year %>年<%=month %>月 </div> </td> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">金额</font> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 工资收入 </font> </td> <td align="center"> <div align="center"><%=ze%>元 </div> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 理财收入 </font> </td> <td> <div align="center"><%=se%>元 </div> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 其他收入 </font> </td> <td> <div align="center"><%=ne%>元 </div> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 合计 </font> </td> <td> <div align="center"><%=zz%>元 </div> </td> </tr> </table> <br><br> <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td width="12%" bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"><%=year %>年<%=month %>月</font> </td> <td width="88%" bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">金额</font> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">工资收入</font> </td> <td><%=ze%>元 <table width="<%=(ze / zz * 1050)%>" border="1" bgcolor="#CCCC33"> <tr> <td>   </td> </tr> </table> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">理财收入</font> </td> <td><%=se%>元 <table width="<%=(se / zz * 1050)%>" border="1" bgcolor="#000000"> <tr> <td>   </td> </tr> </table> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">其他收入</font> </td> <td><%=ne%>元 <table width="<%=(ne / zz * 1050)%>" border="1" bgcolor="#339900"> <tr> <td>   </td> </tr> </table> </td> </tr> </table> </form> <br> <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td> <font color="red" style="font-family:'微软雅黑'">理财建议:</font> <% if(zz>0&&zz<5000){ %> <font color="red" style="font-family:'微软雅黑'">整体收入不高,注意将支出重点放在日常生活上。</font> <% }else if(5000<=zz&&zz<10000){ %> <font color="red" style="font-family:'微软雅黑'">整体收入可观,可进行一些风险较低的理财和基金,市面上涌现大量的基金可供选择,请谨慎挑选。</font> <% }else if(zz>=10000){ %> <font color="red" style="font-family:'微软雅黑'">收入可观,建议可入手几只中高风险的基金或关注股票行情。温馨提醒:股市有风险,投资须谨慎。</font> <% } %> </td> </tr> </table> </body> </html> 在不改变原始代码中加入折线图
05-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值