table 태그 쓰지 않고 테이블 표현하기



display 속성 중 table 관련 속성

table -> table

table-caption -> caption

table-cell -> td

table-column -> col

table-column-group -> colgroup

table-footer-group -> tfoot

table-header-group -> thead

table-row -> tr

table-row-group -> tbody



html)

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, height=device-height, 
                     minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
    <title>Insert title here</title>
    <style>
    /*
    display 속성 중 table 관련 속성
    table -> table
    table-caption -> caption
    table-cell -> td
    table-column -> col
    table-column-group -> colgroup
    table-footer-group -> tfoot
    table-header-group -> thead
    table-row -> tr
    table-row-group -> tbody
    */
    .table {
        display: table;
        width: 100%;
        background: #DAD9FF;
    }
    .table-row-group {
        display: table-row-group;
    }
    .table-row {
        display: table-row;
        height: 40px;
    }
    .table-cell {
        display: table-cell;
        border-bottom : 1px solid #000;
        text-align: center;
        vertical-align: middle;
    }
    .content {
        font-weight: bold;
    }
    </style>
</head>
 
<body>
<div class="table">
    <div class="table-row-group">
        <div class="table-row">
            <div class="table-cell content">01</div>
            <div class="table-cell">제목을 입력하세요</div>
            <div class="table-cell">2017-04-10</div>
        </div>
        <div class="table-row">
            <div class="table-cell content">02</div>
            <div class="table-cell ">제목을 입력하세요2</div>
            <div class="table-cell">2017-04-11</div>
        </div>
    </div>
</div>
</body>
</html>
cs



결과


+ Recent posts