out.println("<table border=\"1\" width=\"100%\">");中 \ 的意思

本文详细解释了HTML和XML中的转义字符用法,包括如何使用转义字符来正确显示特殊符号,如小于号、大于号等,并举例说明了在代码中的实际应用。

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

1.out.println("<table border=\"1\" width=\"100%\">");中 \ 的意思?

border=\"1\意思就是设置他的边框线的粗细大小, “\”是转意的意思,输出识别不了,需要用斜杠“转意”。
2.转义字符

a.HTML的&lt; &gt;&amp;&quot;&copy;分别是<,>,&,",©;的转义字符
b.XML只有5个转义符: &lt; &gt;&amp; &quot; &apos;


                  转义字符表:

``` <% List<test_information> list = (List<test_information>)session.getAttribute("date"); String jsonString = new com.google.gson.Gson().toJson(list); %> <div id="overlay" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background-color:rgba(0,0,0,0.5); z-index:99;"></div> <div class = "tit">查看凭证</div> <div class = "Ribbon"> <table class = "R_t"> <tr> <td style="white-space: nowrap; border-right: none !important;" class = "left_Ribbon"> <!-- 按钮1 --> <input type="button" value="传统记账" class="R_button_1" onclick = "accounting.show()"> <!-- 表单2 - 导出 --> <form action="" class="inline-form"> <input type="submit" value="导出" class="R_button"> </form> <!-- 表单3 - 打印 --> <form id="printForm" action="white.jsp" method="post" class="inline-form"> <input type="hidden" id="selectedTelsHiddenField" name="telsToPrint"> <input type="submit" value="打印" onclick="return submitSelectedTels();" class="R_button"> </form> <!-- 按钮4 --> <input type="button" value="模板" onclick="template.show()" class="R_button"> </td> <td class = "search_box"> <input type = "text" name = "search_name"class = "search_text" placeholder = "搜索关键字"> <input type="button" value="搜索" onclick="performSearch()" class = "search_button"> </td> </tr> </table> </div> <div class="body"> <table class="cer" > <% for(test_information news:list) { %> <!-- 将每条记录分为两列展示 --> <tr class = "head_tr"> <td class="zero_box"> <input type="checkbox" name="selectedTels" value="<%=news.getTel()%>" onchange="updateSelection(this)" style = "zoom : 300%"> </td> <td class="first_box"> <table> <tr> <td class="material_box"><%= news.getMaterial() %></td> </tr> <tr> <td class="time_box"><%= news.getStart_time() %></td> </tr> </table> </td> <td class="second_box"> <%= news.getWashing_method() %> <br/> <%= news.getPrice() %> </td> <td class="third_box"> <form action =""> <input name = "id" value ="<%=news.getTel() %>" type = "hidden"> <input type ="submit" class = "func_button" value = "税费" ><br> <input type ="submit" class = "func_button" value = "查看凭证" ><br> <input type ="submit" class = "func_button" value = "删除凭证" > </form> </td> </tr> <% } %> </table>```怎么解决吧list转换成json格式后再table中的for循环无法使用的问题
03-20
<%@page contentType="text/html" pageEncoding="UTF-8"%><%@ page language="java" import="java.sql.*"%><!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>学生信息查询</title></head><body bgcolor="CCCFFF" align="center"> <br> <table border="2" bgcolor="CCCEEE" width="600" align="center"> <tr bgcolor="CCCCCC" align="center"> <th>记录条数</th> <th>学号</th> <th>姓名</th> <th>性别</th> <th>年龄</th> <th>体重</th> </tr> <% Connection conn = null; ResultSet rs = null; Statement stmt = null; String sDBDriver = "com.mysql.jdbc.Driver"; String sConnStr = "jdbc:mysql://localhost:3306/student?useUnicode=true&characterEncoding=utf-8"; String username = "root"; String password = "bl"; int count=0; //2 装载驱动程序 try { Class.forName(sDBDriver); } catch (ClassNotFoundException ex) { System.err.println(ex.getMessage()); } try { //3 建立数据库连接 conn = DriverManager.getConnection(sConnStr, username, password); //4 创建Statement对象 stmt = conn.createStatement(); //5 执行sql语句 String sql = "select * from stu;"; rs = stmt.executeQuery(sql); //6 处理结果 //6 处理结果 if (rs != null) { count = 0; while (rs.next()) { count++; int id = rs.getInt("id"); String uname = rs.getString("name"); String sex = rs.getString("sex"); int age = rs.getInt("age"); double weight = rs.getDouble("weight"); %> <tr> <td><%=count%></td> <td><%=id%></td> <td><%=uname%></td> <td><%=sex%></td> <td><%=age%></td> <td><%=weight%></td> </tr> <% } } } catch (SQLException e1) { out.println(e1); } finally { //7 关闭链接 conn.close(); } %> </table> 你要查询的学生数据表中共有<%=count%> <font size="5" color="red"> </font>人</body></html>
05-14
我发你一个导航页代码,你协调好它们之间的关系,并且用easyui美化它们。 导航页ProNv:“<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>商品基本信息管理系统</title> </head> <frameset rows="15%,*" cols="*" frameborder="yes" border="5" framespacing="0"> <frame src="<%=request.getContextPath()%>/prohome/top.jsp" name="topFrame" scrolling="NO" noresize > <frameset cols="25%,*" frameborder="yes" border="5" framespacing="0"> <frame src="<%=request.getContextPath()%>/prohome/left.jsp" name="leftFrame" scrolling="YES" noresize> <frame src="<%=request.getContextPath()%>/prohome/welcome.jsp" name="mainFrame"> </frameset> </frameset> <noframes> <body>您的浏览器无法处理框架!</body> </noframes> </html> ” 左页面:“<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="javax.servlet.http.HttpServletRequest"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="../proinfomgmt/ProInfolist.jsp" target="mainFrame">商品基本信息列表</a></td> </tr> <tr> <td><a href="../proinfomgmt/QueryProInfoSelectVal.jsp" target="mainFrame">商品列表查询</a></td> </tr> <tr> <td><a href="../proinfomgmt/QueryProInfo.jsp" target="mainFrame">查询商品基本信息</a></td> </tr> <tr> <td><a href="../proinfomgmt/QueryProInfoMultConds.jsp" target="mainFrame">多条件查询学生基本信息</a></td> </tr> <tr> <td><a href="../proinfomgmt/AddProInfo.jsp" target="mainFrame">添加商品基本信息</a></td> </tr> <tr> <td><a href="../proinfomgmt/ProInfolistforModi.jsp" target="mainFrame">修改或删除商品基本信息</a></td> </tr> <tr> <td><a href="../invinfomgmt/Invinfolist.jsp" target="mainFrame">库存信息列表</a></td> </tr> <tr> <td><a href="../invinfomgmt/QueryInvInfoMultConds.jsp" target="mainFrame">多条件查询库存信息</a></td> </tr> <tr> <td><a href="../invinfomgmt/QueryInvInfoSelectVal.jsp" target="mainFrame">库存列表查询</a></td> </tr> <tr> <td><a href="../Inbinfomgmt/AddInbInfo.jsp" target="mainFrame">添加入库信息</a></td> </tr> <tr> <td><a href="../Inbinfomgmt/InbInfolistforModi.jsp" target="mainFrame">修改或删除入库信息</a></td> </tr> <tr> <td><a href="../Outinfomgmt/AddOutInfo.jsp" target="mainFrame">添加出库信息</a></td> </tr> <tr> <td><a href="../Outinfomgmt/OutInfolistforModi.jsp" target="mainFrame">修改或删除出库信息</a></td> </tr> <tr> <td><a href="../userinfomgmt/UserInfolistforModi_1.jsp" target="mainFrame">员工重置密码</a></td> </tr> <% String operator_id = (String) request.getSession().getAttribute("user"); //下一句不能用== if ("U202340848".equals(operator_id)) { %> <tr> <td><a href="../userinfomgmt/AddUserInfo.jsp" target="mainFrame">管理员添加员工信息</a></td> </tr> <tr> <td><a href="../userinfomgmt/UserInfolist_1.jsp" target="mainFrame">管理员查看员工列表</a></td> </tr> <tr> <td><a href="../userinfomgmt/UserInfolistforModi.jsp" target="mainFrame">管理员重置员工密码和删除员工信息</a></td> </tr> <tr> <td><a href="../userinfomgmt/QueryUserInfoSelectVal.jsp" target="mainFrame">管理员通过列表查询员工信息</a></td> </tr> <tr> <td><a href="../userinfomgmt/QueryUserInfo.jsp" target="mainFrame">管理员精准查询员工信息</a></td> </tr> <% } if ("".equals(operator_id)) { System.out.println("无session");//测试用 %> <%} %> </table> </body> </html> ” 主页面:“<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>商品基本信息管理</title> </head> <body style="background: url(../image/welcome.jpg); background-size:40% 100%; background-attachment: fixed; background-repeat:no-repeat; background-position:center center"> </body> </html> ” 顶端页面:“<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>商品基本信息管理系统</title> </head> <body> <h1 align="center">商品基本信息管理系统</h1> <div align="right"><a href="<%=request.getContextPath()%>/UserLogousvlt">注销</a></div> </body> </html> ”
最新发布
07-06
``` <%@ page language="java" import="test_package.*" import="java.util.*" import="java.sql.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <link rel = "stylesheet" href = "../style/account_set.css"> </head> <body> <% List<test_information> list=new ArrayList<>(); try{ Class.forName("com.mysql.cj.jdbc.Driver"); String url="jdbc:mysql://localhost:3306/washcustomer"; String username="root"; String password="zqz20011222."; Connection c =DriverManager.getConnection(url,username,password); Statement s=c.createStatement(); String sql="select * from clothes"; ResultSet rs= s.executeQuery(sql); while(rs.next()) { String expected_time; if(rs.getString("expected_time").compareTo("点击选择时间")==0) { expected_time="未选择时间"; } else { expected_time=rs.getString("expected_time"); } test_information clothes=new test_information(rs.getString("material"),rs.getString("owner_tel"),rs.getString("start_time"),expected_time,rs.getInt("price"),rs.getString("washing_method"),rs.getString("clothes_state"),rs.getString("bill_state"),rs.getString("number")); list.add(clothes); } } catch(SQLException e) { e.printStackTrace(); System.out.println("操作失败"); } %> <tit >当前账套</tit> <input type = "button" value = "添加账套" onclick = "add_account.show()" class = "add_a"> <table border=1 class="t"> <tr> <th class = "name">单位名称</th><th class = "id">纳税人识别号</th><th class = "func">操作</th><th class = "func">删除</th></tr> <%for(test_information news:list) {%> <tr> <th class = "name"><%=news.getMaterial() %></th> <th class = "id"><%=news.getTel() %></th> <th class = "func"><form action = ""><input value = "<%=news.getTel() %>" type = "hidden"><input class="op" type = "submit" value ="进入账套"></form></th> <th class = "func"><form action = ""><input value = "<%=news.getTel() %>" type = "hidden"><input class = "op" type = "submit" value ="删除账套"></form></th> </tr> <%} %> </table> <dialog id ="add_account"> <form action = "" > <h1 class = "add_tit">添加账套</h1><br> <h1 class = "t1">单位名称</h1><input type = "text" class = "information" name = "name"><br> <h1 class = "t1">纳税人识别号</h1><input type = "text" class = "information" name = "id"><br> <h1 class = "t1">行业</h1><input type = "text" class = "information" name = "industry"><br> <h1 class = "t1">增值税种类</h1><select class = "select" name = "type"><option>小规模纳税人</option><option>一般纳税人</option></select><br> <h1 class = "t1">审核凭证</h1><select class = "select" name = "check"><option>审核</option><option>不审核</option></select><br> <input type = "submit" value = "新增账套"> <input type = "button" value = "清空" id = "clear"> <input type = "button" value = "返回" onclick = "add_account.close()"> </form> </dialog> <script> document.getElementById("clear").addEventListener("click", function () { var inputs = document.getElementsByClassName("information"); for (let i = 0; i < inputs.length; i++) { inputs[i].value = ""; // 文本框清空 } let selects = document.getElementsByTagName('select'); for(let j=0;j<selects.length ;j++){ selects[j].selectedIndex =0; // 恢复下拉列表至初始状态 } }); </script> </body> </html>```让遮罩在弹窗和主页面之间,关闭弹窗后遮罩也消失
03-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值