PlayData/WebUI

[Day 19 | Web] HTML(ํŠนํžˆ Table tag ์œ„์ฃผ)

๊น€์œ ๋‹ˆ์ฝ˜ 2021. 12. 3. 17:53

์ง€์˜ฅ์˜ MySQL๊ณผ ์ž๋ฐ”๋ฅผ ํ•ฉ์นœ ์ˆ˜์—… ๋์—...

๋“œ๋””์–ด html๋กœ ๋„˜์–ด์™”๋‹ค.

 

ํ•œ ์ˆจ ๋Œ๋ฆด ์ˆ˜ ์žˆ๋Š” ์ค„ ์•Œ์•˜๋Š”๋ฐ

 

 

 

๋ฉ”๋ชจ์žฅ์— ์“ด ์ฝ”๋“œ๊ฐ€ ํฌ๋กฌ์œผ๋กœ ์—ด์—ˆ์„ ๋–„

์ฝ”๋“œ๊ฐ€ ๊ทธ๋Œ€๋กœ ํฌ๋กฌ์—์„œ ๋ณด์—ฌ์„œ ๋„ˆ๋ฌด ๋‹นํ™ฉํ–ˆ๋‹ค

 

๋‚˜๋งŒ..๊ทธ๋ž˜...?

 

#ํฌ๋กฌ์œผ๋กœ HTML ์•ˆ์—ด๋ฆด ๋•Œ ํ•ด๊ฒฐ๋ฒ• 

์นœ์ ˆํ•œ ๋™๋ฃŒ ์ˆ˜๊ฐ•์ƒ๋ถ„์ด ํ•ด๊ฒฐํ•ด์ฃผ์…จ๋Š”๋ฐ

(๋‘ ์‚ฌ๋žŒ์˜ ์ปดํ„ฐ ์„ค์ •์ด๋ผ ํ•˜๋‚˜๋Š” ํ•œ๊ธ€, ํ•˜๋‚˜๋Š” ์˜๋ฌธ ๋ฒ„์ „์ด์ง€๋งŒ)

์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •์„ ์ฒดํฌํ•ด์ฃผ๋ฉด ๋œ๋‹ค. ๋‚˜๋Š” Format์ด Rich Text๋กœ ๋˜์–ด์žˆ์–ด์„œ --> Plain  Text๋กœ ๋ฐ”๊พธ์–ด์ฃผ์—ˆ๋‹ค. 

 

 

 

 

 

ํŒŒ์ผ์ด ๋ถ„๋ฆฌ๊ฐ€๋˜๋ฉด, 

๋ถ„๋ฆฌ๋œ ํŒŒ์ผ ๋‚ด์šฉ์€ ํ•ด๋‹น ์†Œ์Šค์—๋Š” ๋‚˜์˜ค์ง€ ์•Š๋Š”๋‹ค. 

 

HTML์€ ๊ณ„์ธต์  ๊ตฌ์กฐ์— ์˜ํ•ด ๊ตฌ์กฐํ™”๋œ๋‹ค. 

 

- ๊ธ€์ž ํƒœ๊ทธ
	[์ œ๋ชฉ๊ธ€์ž]
	- h(heading) -> h1 ~ h6
	[๋ณธ๋ฌธ์˜์—ญ]
	- p(paragraph), br(break), hr(horizontal rule)
	[ํ•˜์ดํผ๋งํฌ]
	- a(anchor), href(hyper reference)	
	[๊ธ€์ž ๋ชจ์–‘]
	- b(bold) , i(italic), small, sub(subscript), sup(superscript), ins(insert), del(delete)
    
    
 - ๋ชฉ๋ก(list) ํƒœ๊ทธ : ol,l(ordered list) ul(unordered list) ,li(list)
	[์ˆœ์„œ์žˆ์Œ]
		<ol> 
		     <li(list)>~/<li>
		</ol>

    [์ˆœ์„œ์—†์Œ] 
		<ul> 
		     <li(list)>~/<li>
		</ul>
        
        ol,l(ordered list) ul(unordered list) ,li(list item)
        



- ํ…Œ์ด๋ธ” ํƒœ๊ทธ: <table>, <thead> , <tbody>, <th(table heding)> ,<tr(table row)>, <td(table data)>
	
	<table>
		<thead>
			<tr> <th></th> ,,,,  </tr>
		</thead>
		<tbody>
			<tr> <td></td> ,,,,  </tr>
			<tr> <td></td> ,,,,  </tr>
		<tbody>
	</table>

<tr> ๋‹จ์œ„๊ฐ€ ํ–‰!

<td> ๋‹จ์œ„๊ฐ€ ์—ด!!

 

ํ‘œ๋ฅผ ๋งŒ๋“ค๋•Œ์—๋Š” ์ผ๋‹จ ์—ด๊ณผ ํ–‰์„ ๋‚˜๋ˆ„์–ด์„œ ์นธ๋ถ€ํ„ฐ ๋งŒ๋“ค์–ด๋‘๊ณ  ์‹œ์ž‘ํ•˜๊ธฐ !!!!

 

์ด๋Ÿฐ์‹์œผ๋กœ ๋ง์ด๋‹ค.

<!DOCTYPE html>
<html>
<head>
    <title>HTML Table Test01 Page</title>
</head>

<body>
    <table border="1">

        <caption> Caption </caption>

        <colgroup>
            <col span="2" style="background: orange;"/>
            <col span style="background: greenyellow;"/>
        </colgroup>
        
        
        <thead style="background: green; color: white;"> <!-- thead๋Š” ์˜์—ญ์„ ๊ตฌ๋ถ„ํ•˜๋Š” ๊ฒƒ, ํ–‰๊ณผ ๋”ฑํžˆ ์ƒ๊ด€ X-->
            <tr> <th> th </th> <th> th </th> <th> th </th> </tr>
            
        </thead>
        
        
        <tbody> 
            <tr> <td> td </td> <td> td </td> <td> td </td> </tr>
            <tr> <td> td </td> <td> td </td> <td> td </td> </tr>>
            <tr> <td> td </td> <td> td </td> <td> td </td> </tr>>
        </tbody>
        
        
        
        <tfoot style="background: yellow; color: red">
            <tr> <td> td </td> <td> td </td> <td> td </td> </tr>
        </tfoot>
        
        
    </table>
</body>
</html>

<tr> ๋‹จ์œ„๊ฐ€ ํ–‰!

<td> ๋‹จ์œ„๊ฐ€ ์—ด!!

 

์ดํ•˜ ํ•œ๊ตญ์˜ ์ฐจ ๋ฌธ์ œ๋ฅผ ํ’€์–ด๋ณด์ž! 

<!DOCTYPE html>
<html>
    <head>
        <title>HTML5 Table ํƒœ๊ทธ</title>
    </head>
    <body>
        <table border="1">
            <tr>
                <th colspan="6
                <th colspan="6">ํ•œ๊ตญ์˜ ์ฐจ</th>
            </tr>
            <tr>
                <th rowspan="6">๋ฟŒ๋ฆฌ์ฐจ</th>
                <td>์ธ์‚ผ์ฐจ</td>
                <th rowspan="9">๊ณผ์ผ์ฐจ</th>
                <td>์ˆ˜์ •๊ณผ</td>
                <th rowspan="5">์žŽ์ฐจ</th>
                <td>๋ฝ•์žŽ์ฐจ</td>
            </tr>
            <tr>
                <td>๋‹น๊ท€์ฐจ</td>
                <td>์œ ์ž์ฐจ</td>
                <td>๊ฐ์žŽ์ฐจ</td>
            </tr>
            <tr>
                <td>์ƒ๊ฐ•์ฐจ</td>
                <td>๊ตฌ๊ธฐ์ž์ฐจ</td>
                <td>์†”์žŽ์ฐจ</td>
            </tr>
            <tr>
                <td>์นก์ฐจ</td>
                <td>๋Œ€์ถ”์ฐจ</td>
                <td>๊ตญํ™”์ฐจ</td>
            </tr>
            <tr>
                <td>๋‘ฅ๊ตด๋ ˆ์ฐจ</td>
                <td>์˜ค๋ฏธ์ž์ฐจ</td>
                <td>์ด์Šฌ์ฐจ</td>
            </tr>
            <tr>
                <td>๋งˆ์ฐจ</td>
                <td>๋งค์‹ค์ฐจ</td>
                <th rowspan="4">๊ธฐํƒ€</th>
                <td>๋‘์ถฉ์ฐจ</td>
            </tr>
            <tr>
                <th rowspan="3">๊ณก๋ฌผ์ฐจ</th>
                <td>๋ณด๋ฆฌ์ฐจ</td>
                <td>๋ชจ๊ณผ์ฐจ</td>
                <td>์˜์ง€๋ฒ„์„ฏ์ฐจ</td>
            </tr>
            <tr>
                <td>์˜ฅ์ˆ˜์ˆ˜์ฐจ</td>
                <td>์‚ฐ์ˆ˜์œ ์ฐจ</td>
                <td>๊ทค๊ฐ•์ฐจ</td>
            </tr>
            <tr>
                <td>ํ˜„๋ฏธ์ฐจ</td>
                <td>ํƒฑ์ž์ฐจ</td>
                <td>์Œํ™”์ฐจ</td>
            </tr>
        </table>
    </body>
</html>

 

 

 

 

๋‘ ๊ฐ€์ง€ ์Šคํƒ€์ผ์ด ์ ์šฉ๋˜๋ฉด (colgroup / style) --> ๊ฐ€๊นŒ์šด ๊ฒƒ์ด ์ ์šฉ๋จ.

 

์˜ค๋Š˜ ๋ฐ˜๋“œ์‹œ ๊ฑด์ ธ์•ผ ํ•˜๋Š” ๊ฒƒ์€ Table Tag! 

 

 

 

์—ฌ๋Ÿฌ๊ฐ€์ง€ ๊ฐ„๋‹จํ•œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋“ค์€ ๊ทธ๋ƒฅ ๊ท€์ฐฎ์œผ๋‹ˆ ํŒŒ์ผ๋กœ ์˜ฌ๋ฆฐ๋‹ค.

 

Step01.zip
0.01MB

 

 

 

 

 

์ˆ˜๊ฐ•์ƒ๋ผ๋ฆฌ ํ€ด์ฆˆ๋‚ด๊ธฐ๋„ ํ–ˆ๋‹ค.

ํ…Œ์ด๋ธ”ํƒœ๊ทธ๋กœ ์ด๊ฑฐ ๋งŒ๋“ค๊ธฐ 

์˜ค? ๋‚˜ ํ• ์ค„์•Œ์ž–์•„? 

<!DOCTYPE html>
<html>
    <head>
        <title> </title>   
    </head>

    <body>

        <table border="1" style="outline: green;">
            <thead> 
                <tr> <th colspan="4"> head </th> </tr>
            </thead>


            <tbody style="background: gray;"> 
                <tr> 
                    <td colspan="2"> 1 </td> 
                    <td> 2 </td> 
                    <td rowspan="2"> 3 </td> 
                </tr>

                <tr> 
                    <td rowspan="2"> 1 </td> 
                    <td> 2 </td> <td> 3 </td>  
                </tr>


                <tr>                           
                    <td colspan="2"> 2 </td> 
                     <td> 4 </td> 
                </tr>

                <tr> 
                    <td> 1 </td> 
                    <td> 2 </td> 
                    <td rowspan="3"> 3 </td>
                    <td> 4 </td> 
                </tr>

                
                <tr> 
                    <td rowspan="2" colspan="2"> 1 </td>    
                    <td> 4 </td> 
                </tr>


                <tr> 
                    <td> 4 </td> 
                </tr>

            </tbody>

            <tfoot> 
                <tr> <td colspan="4"> foot </td> </tr>
            </tfoot>

        </body>

    </table>
</html>

 

 

 

๋‹ค์Œ ์ฃผ์—๋Š” CSS, JS, SERVLE? ๋“ฑ๋“ฑ ๋‹ค์„ฏ ๊ฐ€์ง€์˜ ์–ธ์–ด๊ฐ€ ๋‹ค ๊ฐ™์ด ๋‚˜์˜ค๋Š”๋ฐ

๊ฒ์ฃผ๋Š”๊ฑฐ ์•„๋‹ˆ๋ผ๋Š”๋ฐ 

 

 

 

 

 

 

๊ฒ๋จน์€๊ฑด ์•„๋‹ˆ๊ณ 

 

์†Œํ™”๋ถˆ๋Ÿ‰์ž…๋‹ˆ๋‹ค...

ใ… _ใ… 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

์œผ์•…!

 

 

 

 

 

 

์ง„๋„ ๊ทธ๋งŒ