반응형

vinaleech.com_YouTube [Google Inc.] (v1.3.0 v1.3.0.5707 3GS Univ RLSA LP os50)-Widow-iCPDA.rc30c5.ipa;


반응형

'프로그래밍 > 기타' 카테고리의 다른 글

DNS - (Domain Name System)  (0) 2019.02.28
반응형


◎ DB.properties 파일

▼ 내용

properties 의 파일에 가져올 key = 내용 ; 식으로 적어준다.

어차피 java에선 properties 에서 getproperty 로 읽어오기 때문이다.

driver=org.postgresql.Driver url=jdbc:postgresql://localhost:5432/postgres username=postgres password=goodday

◎ 외부 properties 읽기

▼ 내용

.jar 파일과 .properties의 같은 폴더 안에 잇을경우 파일 이름 DB.properties 만써주고

다른경로에 잇을경운 fileReader 안에 ../../ 같은 상대경로를 써주거나 절대경로를 써주면된다.

import java.io.*; import java.util.*; public class EntryMain { public static void main(String[] args) { FileReader resources= new FileReader("DB.properties"); Properties properties = new Properties(); try { properties.load(resources); System.out.println(properties.getProperty("driver")); System.out.println(properties.getProperty("username")); System.out.println(properties.getProperty("password")); System.out.println(properties.getProperty("url")); } catch (IOException e) { e.printStackTrace(); } } }

◎ 내부 properties 읽기

▼ 내용

내부 properties 에 잇을경운 아래 resource 변수에 패키지 구조와 파일명을 써주면된다

import java.io.IOException; import java.io.Reader; import java.util.Properties; public class EntryMain { public static void main(String[] args) { String resource = "config/DB.properties"; Properties properties = new Properties(); try { Reader reader = Resources.getResourceAsReader(resource); properties.load(reader); System.out.println(properties.getProperty("driver")); System.out.println(properties.getProperty("username")); System.out.println(properties.getProperty("password")); System.out.println(properties.getProperty("url")); } catch (IOException e) { e.printStackTrace(); } } }


반응형
반응형


◎ tabl2excel 라이브러리 사용

▼ 내용

table to excel converter

java 단이나 jsp 단으로 poi나 jxl 라이브러리를 사용할수있지만.... 

js 로 바꾸고싶어 찾아보다 사용하기 편한 라이브러리를 발견하여 관련된 사용법을 작성합니다.


아래 소스를 다운받아 엑셀로 실행하엿을경우 위 그림처럼 export가 된다.

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script type="text/javascript" src="../scripts/jquery-1.11.0.js"></script> <script type="text/javascript" src="../scripts/jquery.table2excel.js"></script> </head> <body> <table id="TableToExcel" border=2 width=710 cellpadding=0 cellspacing=0 class='table table-bordered' align=center style='border-collapse:collapse;' > <thead> <tr> <td>번호</td> <td>번호</td> <td>번호</td> </tr> </thead> <tbody> <tr> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>2</td> <td>2</td> <td>2</td> </tr> <tr> <td>3</td> <td>3</td> <td>3</td> </tr> </tbody> </table> <iframe id="txtArea1" style="display:none"></iframe> <!-- IE 호환을 위해서 iframe을 추가해야한다 --> <!-- IE에서는 txtArea1 의 객체를 찾기 때문이다. 크롬은 없어도 된다. 있어도 상관은 없다. --> <input type='button' class='btn btn-inverse' value='excel 다운' style='width:100px;height:36px;font-weight:bold;' onclick="ReportToExcelConverter()" /> </body> <script> function ReportToExcelConverter() { $("#TableToExcel").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "report" +'.xls', //확장자를 여기서 붙여줘야한다. fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); }; </script> </html>

위 소스처럼 table의 id를 지정하고 제이쿼리함수 $("#아이디") 를 지정한다음 위 소스처럼 작성하면 table 을 자동으로 excel 형식으로 export 해준다. script 를 불러올때 꼭 jquery 를 부른다음 table2excel.js 를 로드해야한다. 또한 iframe을 써줘야 ie에서 작동이된다.

excel exprort.zip


예제 파일이다.


https://github.com/rainabba/jquery-table2excel



jquery-table2excel-master.zip



위에 링크가 공식문서고 나는 아래에서 다운받아서 작업하엿기 때문에 둘다 링크를 남긴다



반응형

'프로그래밍 > Jquery' 카테고리의 다른 글

jQuery 란?  (0) 2019.02.27
제이쿼리의 기본문법  (0) 2019.02.27
jQuery - 속성 제어 api (JS의 ELEMENT와 이어짐)  (0) 2019.02.27
JQuery - NODE 객체  (0) 2019.02.27
반응형



◎ <IMG> 태그

<img src="twitterlogo.jpg" alt="트위터">

▼ 내용이 없는 경우는 빈 대체 텍스트 제공 (alt 속성 이용)

alt의 대체 텍스트를 넣을경우 이미지를 있는그대로 표현할수 있는 텍스트를 넣는게 좋다. 예를들어 트위터 로고 img 파일을 너놓고 alt 속성에 새라고 넣으면 이건 잘못된 예시다. 이유는 시각장애인들의 접근성을 위해서이다.

<img src="연혁도.jpg" alt='수자원공사이력' longdesc='text.html' >

▼ 아래처럼 이미지내용이 길거나 복잡한 경우는 longdesc, 대체 콘텐츠 등으로 추가정보 제공

연혁도 같은 img파일의 텍스트가잇는 것 같은경우엔 longdesc='long.html' 같은걸 써서 텍스트를 따로남깁니다.

또한 다른방법으로는 보통 연혁도같은경우 ol li 태그등을 이용하여 텍스트로 표현해주는데 따로 html을 만드는게아니라 이미지 바로밑에 텍스트를 넣어준다 그리고 텍스트의 스타일을 position:absolute: left:-5000% 를 사용하여 넣어준다 이유는 일반사용자는 그림을보고 이해하지만 시각장애인들은 웹페이지를 대신 읽어주는 기계를 사용해서 듣기때문이다. 이미지파일은 못읽고 대체텍스트alt나 그밑에 숨긴텍스트를 읽어서 들려주기때문이다. 간혹 display none으로 하는경우도 있는데 이경우 시각장애인의 장비가 읽어주지 못하는 경우가생긴다. 그래서 position으로 위와같이 작성하는게 좋다



▼ longdescription 확인방법. (마우스 우측버튼 > 설명보기)


◎ <a> 태그

▼ <a> = Anchor (닻)

▼ href = Hypertext Reference

▼ 페이지와 페이지를 연결하는 link

▼ target 속성으로 페이지 열리는 방식 제공 (_blank 라는 속성을 넣어주면 새창열림)

<a href="url" target="_blank"> 텍스트 ></a>

▼ 다른 도메인 연결시 http:// 까지 제공해야함

▼ 파란색 텍스트에 밑줄로 기본제공됨

▼ href의 여러가지 이벤트 #을 주게되면 그뒤에 나오는 id값을 찾아서 스크롤이 이동된다.

1. <a href=""> 링크값에 내용이 없을경우</a> 2. <a href="#">#만 제공하는 경우 </a> 3. <a href="#content">내부링크를 제공하는 경우 </a> 4. <a href="#a">없는 아이디를 넣는경우 </a> 1: 내용이 없을경우 IE의 경우는 내컴퓨터가 열림 , Chrome 는 아무 변화없음 2: #만 제공하는경우엔 scroll이 맨위로 가게됩니다 3: #content는 #뒤에 이름을 써줄경우 내부링크로 작동되어 태그의 id='content' 인 태그를 찾아서 scroll 이 이동됩니다. 4: #a #뒤에 없는 id를 넣을경우 현재 scroll 고정, 현재scroll에서 새창이나 다른 이벤트를 줄경우 사용 #none를 쓰는사람도있는대 #a 로 쓰는게 바람직하다




반응형
반응형


◎ Block Element

div , p , ul , ol , li , dl , dt , dd , h1 ~ h6 , pre noscript , table , hr , form , blockquote , address , fieldset

▼ 테트리스 블록처럼 촘촘이 쌓여가는게 특징이다.

▼ 블록요소 안에 블록요소를 포함할수 있다.

▼ 블록요소 안에 인라인요소를 포함할 수 있다.

▼ 일부 블록요소는 블록요소를 포함할 수 없다. - <address> , <h1>~<h6> , <p> 등


▼ 가로사이즈가 100% 이다.

▼ 가로,세로사이즈 적용 가능하다.

▼ 안쪽여백(padding), 바깥쪽여백(margin) 모든 방향이 다 적용 가능하다.

◎ Inline Element

a , span , img , input , strong , samp , var , cite , abbr q , sub , sup , select , b , strong , em , ins , u , i , textarea

▼ 한 줄로 선처럼 나열된다.

▼ 안쪽여백(padding), 바깥쪽여백 (margin) 은 좌우측만 적용된다.

▼ 가로(width), 세로(height) 사이즈 적용이 안된다.

▼ 일부 요소는 적용 가능하다 .- input , textarea , select , img

▼ 인라인 요소안에는 인라인 요소만 포함한다. 즉, 인라인 요소 안에 블럭요소를 포함할 수 없다.

▼ 자신의 부모의 가로폭보다 현재의 가로폭이 길면 다음줄로 넘어간다.


◎ Heading Element (Head)

<h1> , <h2> , <h3> , <h4> , <h5> , <h6>

▼ 제목(콘텐츠 블록)

▼ inline 요소와 텍스트만 포함할 수 있음

▼ 계층구조를 준수해야함 , 제목을 건너뛰는 구조는 바람직하지 않음 - h1,h2,h3,h4,h5,h6 요소 순서로 나열

▼ <h1> 요소는 한페이지에 한번만 제공함

▼ 굵은 글씨

▼ 제목과 관련된 내용의 소제목들은 h1 h2 h3 으로 쓰지만 관련없는 제목들은 상위제목가 같은 태그를 쓴다.


반응형

'프로그래밍 > HTML' 카테고리의 다른 글

HTML4 - Entity Code  (0) 2019.04.15
HTML4 - <IMG> 태그 , <a> 태그  (0) 2019.04.02
HTML 태그 (Input태그 속성{pattern,required,autofocus,placeholder})  (0) 2019.02.28
HTML5 태그 (2) - article,section,nav  (0) 2019.02.28
HTML 태그  (0) 2019.02.27

+ Recent posts