티스토리 뷰
웹 페이지에서 데이터를 행과 열로 효율적으로 정리할 수 있도록 해준다.
- <table>
- <tr> : 하나의 행을 정의한다
- <th>: table header (보통 굵은 글씨로 가운데 정렬로 나타난다)
- <td>: 왼쪽 정렬로 나타난다
<table style="background-color: white;">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
- border : 표 테두리 설정
예) border: 1px solid black; - border-collapse: 표와 각 행과 열의 테두리가 하나로 합쳐져서 나오길 바랄 때
예) border-collapse: collapse;
- padding : cell 안의 내용과 각 테두리 간의 여백을 설정한다
예) padding: 15px; - text-align
예) text-align: left/ right - border-spacing: cell과 cell 사이에 여백을 추가한다
예) border-spacing: 15px;
참고) border-collapse: collapse; 일때는 사용할 수 없다 - colspan
<table style="background-color: whitesmoke; width: 100%;">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>>
</tr>
<tr>
<td>Bill Gates</td>
<td>55577854</td>
<td>55577855</td>
</tr>
</table>
- rowspan
- caption: 표 이름을 설정 해준다, <table> 태그 바로 다음으로 사용 되어야 한다
예) <caption>Contact info. </caption> - id: table에 하나의 style만 적용하고 싶을 때 사용한다
<!--t01표의 style-->
<head>
<style>
#t01 {
width: 100%;
background-color: #f1f1c1;
}
</style>
</head>
<table id="t01">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
'HTML' 카테고리의 다른 글
HTML Block and Inline Elements & class (0) | 2020.07.23 |
---|---|
HTML Lists (0) | 2020.07.23 |
HTML Images (0) | 2020.07.22 |
HTML Media (0) | 2020.07.22 |
HTML Graphics (0) | 2020.07.22 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- HTML #Headings #Paragraph #Styles
- javascript #datatype
- JSP환경구축
- HTML #media #video #YouTube
- HTML #Canvas #SVG
- HTML #Tables
- UserBean
- HTML_Formatting
- STS4
- HTML_Forms
- 인용문 #주석
- Block_element #inline_element
- 2020Camp
- links lists tables display
- DB4free
- jsp
- meta #link #script #base #HTML
- HTML #class
- text_shadow
- HTML #id #iframe
- HTML #CSS
- fontstyle
- head #title #style
- html
- JSP_CRUD
- box_model
- Mavenproject
- DynamicWebProject
- css
- annotation
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함