学习PHP为什么必须要掌握HTML?
前端开发静态页面的编写主要是html,css,JavaScript,后端就是只服务器环境中的开发,html代码是由浏览器解释执行的,如果只学习PHP那么根本不知道做出来的html页面是什么样子的
为什么选择PHP开发动态网站?
PHP是用来动态生成html代码的,选择PHP是因为PHP流行,而PHP流行的原因是PHP够快,上手快,开发快,迭代快。
表格的代码作业:
实例
<!DOCTYPE HTML> <html> <head> <meta charset="utf=8"> <title>购物清单</title> <style type="text/css"> </style> </head> <body> <table border="1" cellspacing="0" align="center" width="800" height="150"> <caption >购物清单</caption> <tr> <td>编号</td> <td>名称</td> <td>数量</td> <td>缩略图</td> <td>操作</td> </tr> <tr> <th>1</th> <th>水果</th> <th>3</th> <th><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534421748843&di=8f6a24968d3987400eff16ce4271f602&imgtype=0&src=http%3A%2F%2Fwww.cpweb.gov.cn%2Fuploads%2Fallimg%2F160408%2F5429-16040P95346118.jpg" width="100"></th> <th><a href="https://www.jd.com/">点击拥有</a></th> </tr> <tr> <th>2</th> <th>香蕉</th> <th>4</th> <th><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534422083267&di=9455939a34caca2fed678255a6270ed0&imgtype=0&src=http%3A%2F%2Fimg.alicdn.com%2Fimgextra%2Fi1%2F641112321%2FTB2d252kv2H8KJjy1zkXXXr7pXa_%2521%2521641112321-0-daren.jpg"width="100"></th> <th><a href="https://www.jd.com/">点击拥有</a></th> </tr> <tr> <th>3</th> <th>橘子</th> <th>5</th> <th><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534422183490&di=d981a961d5dd0379b3b79c0ea4ede211&imgtype=0&src=http%3A%2F%2Fpic.makepolo.net%2Fnews%2Fallimg%2F20161209%2F1481214949307343.jpg" width="100"></th> <th><a href="https://www.jd.com/">点击拥有</a></th> </tr> <tr> <th>4</th> <th>葡萄</th> <th>3</th> <th><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534422314148&di=e7fc560c451aa7a63ce0d21561511d8c&imgtype=0&src=http%3A%2F%2Fimg3.duitang.com%2Fuploads%2Fitem%2F201506%2F22%2F20150622164452_KkGyP.png" width="100"></th> <th><a href="https://www.jd.com/">点击拥有</a></th> </tr> </table> </body> </html>
运行实例 »点击 "运行实例" 按钮查看在线实例
手抄代码: