JSP/contentType=?
contentType=?
Soul-Learner
2007. 12. 29. 19:41
contentType="application/vnd.ms-excel"
MS-Excel 문서를 브라우저에 출력하는 예
데이터 사이에 탭(Tab)을 삽입하고 줄바꿈할 때는 그냥 엔터(Enter)키를 누른다
<table> 태그를 이용하는 경우
<table border="1">을 사용한 경우
MS-Excel 문서를 브라우저에 출력하는 예
데이터 사이에 탭(Tab)을 삽입하고 줄바꿈할 때는 그냥 엔터(Enter)키를 누른다
<%@ page contentType="application/vnd.ms-excel" %>
<%--response.setContentType("application/vnd.ms-excel"); --%>
100 200 300 400 500
500 400 300 200 100
<%--response.setContentType("application/vnd.ms-excel"); --%>
100 200 300 400 500
500 400 300 200 100
<table> 태그를 이용하는 경우
<%@ page contentType="application/vnd.ms-excel" %>
<%--response.setContentType("application/vnd.ms-excel"); --%>
<html>
<body>
<table>
<tr><td>100</td><td>200</td><td>300</td><td>400</td><td>500</td></tr>
<tr><td>500</td><td>400</td><td>300</td><td>200</td><td>100</td></tr>
</table>
</body>
</html>
<%--response.setContentType("application/vnd.ms-excel"); --%>
<html>
<body>
<table>
<tr><td>100</td><td>200</td><td>300</td><td>400</td><td>500</td></tr>
<tr><td>500</td><td>400</td><td>300</td><td>200</td><td>100</td></tr>
</table>
</body>
</html>
<table border="1">을 사용한 경우
<%@ page contentType="application/vnd.ms-excel" %>
<%--response.setContentType("application/vnd.ms-excel"); --%>
<html>
<body>
<center>
<table border="1">
<tr><td>100</td><td>200</td><td>300</td><td>400</td><td>500</td></tr>
<tr><td>500</td><td>400</td><td>300</td><td>200</td><td>100</td></tr>
</table>
</center>
</body>
</html>