Notice
Recent Posts
Recent Comments
Tags
- javascript redirection
- django 엑셀불러오기
- 404에러페이지
- asp.net core Select
- 바코드 생성하기
- Mac Oracle
- 강제이동
- ViewBag
- 하드 윈도우 복사
- TempData
- asp ftp
- jquery 바코드생성
- 타임피커
- simpe ftp
- 원격ftp
- SSD 복사
- 말줄임표시
- asp.net core swagger
- XSS방어
- php 캐쉬제거
- ASP.Net Core 404
- asp.net dropdownlist
- asp.net Select
- javascript 바코드 생성
- 맥 오라클설치
- 하드 마이그레이션
- XSS PHP
- JavaScript
- ViewData
- swagger 500 error
웹개발자의 기지개
[CSS] 표형식 삼단/이단 나열하기 - 반응형 코딩 본문


|
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Table 삼단 / 이단 예제파일</title>
<style>
:root{
--bg:#fafafa;
--card:#ffffff;
--text:#1a1a1a;
--muted:#6b7280;
--border:#e5e7eb;
--accent:#2563eb;
}
.table-wrap{
background: var(--card);
border: 1px solid var(--border);
border-radius: 14px;
overflow: hidden;
box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.table-scroll{
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
table{
margin:0 auto;
width:97%;
border-collapse: collapse;
min-width: 420px;
}
caption{
text-align:left;
padding: 16px 18px 0;
color: var(--muted);
font-size: 13px;
}
thead th{
text-align:left;
font-weight: 700;
padding: 14px 18px;
border-bottom: 1px solid var(--border);
background: #e2e2e2;
white-space: nowrap;
}
tbody tr:nth-child(even){
background: #faf3ed; /* ← 2줄마다 연한 색상 */
}
tbody td{
padding: 14px 18px;
border-bottom: 1px solid var(--border);
vertical-align: middle;
}
a.tel{
color: var(--accent);
text-decoration: none;
}
a.tel:hover{ text-decoration: underline; }
@media (max-width: 640px){
thead { display: none; }
table, tbody, tr, td { display: block; width: 100%; }
table { min-width: 0; }
tbody tr{
border-bottom: 1px solid var(--border);
padding: 10px 12px;
}
tbody td{
border: 0;
padding: 8px 6px;
display: grid;
grid-template-columns: 110px 1fr;
gap: 8px;
align-items: center;
}
tbody td::before{
content: attr(data-label);
font-size: 13px;
color: var(--muted);
}
tbody td[data-label="상호"]{
padding-top: 4px;
font-weight: 700;
font-size: 16px;
}
tbody td:last-child{
padding-bottom: 10px;
}
.table-wrap{
border-radius: 12px;
}
}
:root{
--supdir-bg:#f7fafc; /* 전체 배경 */
--supdir-card:#ffffff; /* 카드 바탕 */
--supdir-txt:#111827;
--supdir-muted:#6b7280;
--supdir-pill:#f2f6fb; /* 카드 안 연한 배경 */
--supdir-border:#e5e7eb;
}
.supdir-card{
background: var(--supdir-card);
border: 1px solid var(--supdir-border);
border-radius: 14px;
padding: 16px;
box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
/* 반응형 그리드: 모바일 2, PC 3 */
.supdir-grid{
list-style:none;
margin: 0;
padding: 0;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr)); /* 기본(모바일) 2열 */
gap: 12px;
}
@media (min-width: 1024px){
.supdir-grid{
grid-template-columns: repeat(3, minmax(0, 1fr)); /* PC 3열 */
gap: 14px;
}
}
/* 각 아이템(연한 배경 & 살짝 입체감) */
.supdir-item{
background: var(--supdir-pill);
border: 1px solid var(--supdir-border);
border-radius: 12px;
padding: 14px 16px;
min-height: 60px;
display: flex;
align-items: center;
justify-content: center;
text-align:center;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
transition: transform .08s ease, box-shadow .08s ease;
}
.supdir-item:hover{
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.supdir-item:focus-within{
outline: 2px solid #a5b4fc;
outline-offset: 2px;
}
/* 긴 이름 두 줄 허용하고 싶다면 아래 두 줄로 교체
white-space: normal;
display:block; (그리고 min-height 조정)
*/
</style>
</head>
<body>
<strong style="color:#bd896c;">판매점</strong>
<section class="table-wrap" aria-labelledby="contact-caption">
<div class="table-scroll">
<table>
<caption id="contact-caption"></caption>
<thead>
<tr>
<th scope="col">상호</th>
<th scope="col">전화번호</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="상호">컴퍼니 본사 (논현동)</td>
<td data-label="전화번호">
070-1111-2222
</td>
</tr>
<tr>
<td data-label="상호">가나다회사</td>
<td data-label="전화번호">
</td>
</tr>
<tr>
<td data-label="상호">거성회사 (대구 장기동)</td>
<td data-label="전화번호">
053-1111-2222
</td>
</tr>
<tr>
<td data-label="상호">가나다타일 (제주)</td>
<td data-label="전화번호">
064-123-4567
</td>
</tr>
</tbody>
</table>
</div>
</section>
<br><br>
<strong style="color:#bd896c;">납품실적 / 납품처</strong>
<br/><br/>
<section class="supdir-card" aria-label="납품실적 / 납품처">
<ul class="supdir-grid">
<li class="supdir-item" title="다빈치건설">다빈치건설</li>
<li class="supdir-item" title="김포회사">김포회사</li>
<li class="supdir-item" title="코리아주식회사">코리아주식회사</li>
<li class="supdir-item" title="종합건설(주)">종합건설(주)</li>
<li class="supdir-item" title="유비종합회사(주)">유비종합회사(주)</li>
<li class="supdir-item" title="건축사무소">건축사무소</li>
</ul>
</section>
</body>
</html>
|
cs |
'웹퍼블리싱' 카테고리의 다른 글
| [CSS] Youtube 소스 붙이기 - 반응형 형태로 붙이기 (0) | 2025.10.15 |
|---|---|
| [CSS] 특수기호 문자하나 넣고 다음줄에 들여쓰기 해보기 (0) | 2025.10.15 |
| [웹퍼블리싱] 기본 모달창 만들기 2 (0) | 2025.09.24 |
| [웹퍼블리싱] 동영상 자막 연동하기 (0) | 2025.09.18 |
| [웹퍼블리싱] 반응형 코딩 table , PC / 모바일 구분 예제 1 (1) | 2025.09.06 |
Comments