Html내의 Table을 엑셀로 저장하기


아래와 같은 html내의 Table을 엑셀로 저장하는

아주 간단한 팁입니다.


번호

멤버별명

카페주소

1

다자래

http://cafe.naver.com/webdeveloper.cafe

2

오렌지

http://cafe.naver.com/webdeveloper.cafe


<%

 

function strLenChk(strTemp)
  if len(strTemp) < 2 then
     strAdd = "0"
  strTemp  = strAdd &strTemp
  end if
  strLenChk = strTemp
end function

 

toYear  =  year(now)
toMonth = strLenChk(month(now))
toDay   = strLenChk(day(now))

 

strToday = toYear & toMonth & toDay
strTitle = "XLS저장예제"
strfileExtension = ".XLS"

 

'다른건 중요하지 않습니다. 아래 두줄만 삽입해 주시고, 밑에 저장하고자 하는 데이타를 테이블 태그를 이용해서

'삽입하시면 됩니다. 

Response.ContentType = "application/vnd.ms-excel"

Response.AddHeader "Content-Disposition","attachment; filename="& strToday & strTitle & strfileExtension
%>

<!---- 여기서 부터  저장하고자 하는 데이타를 테이블 태그를 이용해서 삽입하시면 됩니다. ----->
<table border=1 cellspacing=0 cellpadding=0>
  <tr>
  <td width=115 valign=top style='width:86.4pt;border:solid windowtext 1.0pt;
  mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal>번호</p>
  </td>
  <td width=120 valign=top style='width:90.0pt;border:solid windowtext 1.0pt;
  border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
  solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal>멤버별명</p>
  </td>
  <td width=346 valign=top style='width:259.6pt;border:solid windowtext 1.0pt;
  border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
  solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal>카페주소</p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.4pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal><span lang=EN-US>1</span></p>
  </td>
  <td width=120 valign=top style='width:90.0pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal>다자래</p>
  </td>
  <td width=346 valign=top style='width:259.6pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal><span lang=EN-US>http://cafe.naver.com/webdeveloper.cafe</span></p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.4pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal><span lang=EN-US>2</span></p>
  </td>
  <td width=120 valign=top style='width:90.0pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal>오렌지</p>
  </td>
  <td width=346 valign=top style='width:259.6pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal><span lang=EN-US>http://cafe.naver.com/webdeveloper.cafe</span></p>
  </td>
 </tr>
</table>

2008/02/21 15:56 2008/02/21 15:56

Trackback Address :: 이 글에는 트랙백을 보낼 수 없습니다