質問編集履歴

3

修正後の画面を追加

2018/08/07 03:09

投稿

Tatsurou
Tatsurou

スコア81

test CHANGED
File without changes
test CHANGED
@@ -422,6 +422,14 @@
422
422
 
423
423
  ```
424
424
 
425
+ ## 修正後の画面
426
+
427
+ ![イメージ説明](6c2044b9e10c16c184217ffd89b910dd.png)
428
+
429
+
430
+
431
+
432
+
425
433
  上記のcss記述で実現できました。
426
434
 
427
435
  アドバイスいただきありがとうございました。

2

修正したHTMLを追加

2018/08/07 03:09

投稿

Tatsurou
Tatsurou

スコア81

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- ### 途中まで作ったHTML
17
+ ### 途中まで作ったHTML(ページ下部に修正したソースがあります)
18
18
 
19
19
  私が作ったテーブルのコードは以下の通りです。
20
20
 
@@ -159,3 +159,269 @@
159
159
 
160
160
 
161
161
  [レスポンシブテーブル](https://zurb.com/playground/responsive-tables)
162
+
163
+
164
+
165
+
166
+
167
+ #頂いた回答を元に、修正!
168
+
169
+
170
+
171
+ ```ここに言語を入力
172
+
173
+ <!DOCTYPE html>
174
+
175
+ <html lang="ja">
176
+
177
+ <head>
178
+
179
+ <meta charset="UTF-8">
180
+
181
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
182
+
183
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
184
+
185
+ <title>テーブル</title>
186
+
187
+ <style>
188
+
189
+ /* Foundation v2.1.4 http://foundation.zurb.com */
190
+
191
+ /* Artfully masterminded by ZURB */
192
+
193
+
194
+
195
+ /* --------------------------------------------------
196
+
197
+ Table of Contents
198
+
199
+ -----------------------------------------------------
200
+
201
+ :: Shared Styles
202
+
203
+ :: Page Name 1
204
+
205
+ :: Page Name 2
206
+
207
+ */
208
+
209
+
210
+
211
+
212
+
213
+ /* -----------------------------------------
214
+
215
+ Shared Styles
216
+
217
+ ----------------------------------------- */
218
+
219
+
220
+
221
+ table th { font-weight: bold; }
222
+
223
+ table td, table th { padding: 9px 10px; text-align: left; }
224
+
225
+
226
+
227
+ /* Mobile */
228
+
229
+ @media only screen and (max-width: 767px) {
230
+
231
+
232
+
233
+ table.responsive { margin-bottom: 0; }
234
+
235
+
236
+
237
+ .pinned { position: absolute; left: 0; top: 0; background: #fff; width: 35%; overflow: hidden; overflow-x: scroll; border-right: 1px solid #ccc; border-left: 1px solid #ccc; }
238
+
239
+ .pinned table { border-right: none; border-left: none; width: 100%; }
240
+
241
+ .pinned table th, .pinned table td { white-space: nowrap; }
242
+
243
+ .pinned td:last-child { border-bottom: 0; }
244
+
245
+
246
+
247
+ div.table-wrapper { position: relative; margin-bottom: 20px; overflow: hidden; border-right: 1px solid #ccc; }
248
+
249
+ div.table-wrapper div.scrollable { margin-left: 35%; }
250
+
251
+ div.table-wrapper div.scrollable { overflow: scroll; overflow-y: hidden; }
252
+
253
+
254
+
255
+ table.responsive td, table.responsive th { position: relative; white-space: nowrap; overflow: hidden; }
256
+
257
+ table.responsive th:first-child, table.responsive td:first-child, table.responsive td:first-child, table.responsive.pinned td { display: none; }
258
+
259
+
260
+
261
+
262
+
263
+ }
264
+
265
+
266
+
267
+ /* responsive-tables.css 以外で追加した CSS */
268
+
269
+ div.table-wrapper{
270
+
271
+ border: 1px solid #ccc;
272
+
273
+ }
274
+
275
+ @media print, screen and (max-width: 750px) {
276
+
277
+ .table-wrapper .scrollable{
278
+
279
+ background: linear-gradient(to left, rgba(255, 255, 255, 0), white 15px) 0 0/50px 100%, linear-gradient(to left, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.2)) 0 0/20px 100%, linear-gradient(to right, rgba(255, 255, 255, 0), white 15px) right/50px 100%, linear-gradient(to right, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.2)) right/20px 100%;
280
+
281
+ background-repeat: no-repeat;
282
+
283
+ background-attachment: local, scroll, local, scroll;
284
+
285
+ }
286
+
287
+ }
288
+
289
+ </style>
290
+
291
+ </head>
292
+
293
+ <body>
294
+
295
+
296
+
297
+ <table class="responsive">
298
+
299
+ <tr>
300
+
301
+ <th>項目1243</th>
302
+
303
+ <th>項目1243</th>
304
+
305
+ <th>項目1243</th>
306
+
307
+ <th>項目1243</th>
308
+
309
+ <th>項目1243</th>
310
+
311
+ <th>項目1243</th>
312
+
313
+ <th>項目1243</th>
314
+
315
+ <th>項目1243</th>
316
+
317
+ </tr>
318
+
319
+ <tr>
320
+
321
+ <td>項目</td>
322
+
323
+ <td>項目</td>
324
+
325
+ <td>項目</td>
326
+
327
+ <td>項目</td>
328
+
329
+ <td>項目</td>
330
+
331
+ <td>項目</td>
332
+
333
+ <td>項目</td>
334
+
335
+ <td>項目</td>
336
+
337
+ </tr>
338
+
339
+ <tr>
340
+
341
+ <td>項目</td>
342
+
343
+ <td>項目</td>
344
+
345
+ <td>項目</td>
346
+
347
+ <td>項目</td>
348
+
349
+ <td>項目</td>
350
+
351
+ <td>項目</td>
352
+
353
+ <td>項目</td>
354
+
355
+ <td>項目</td>
356
+
357
+ </tr>
358
+
359
+ <tr>
360
+
361
+ <td>項目</td>
362
+
363
+ <td>項目</td>
364
+
365
+ <td>項目</td>
366
+
367
+ <td>項目</td>
368
+
369
+ <td>項目</td>
370
+
371
+ <td>項目</td>
372
+
373
+ <td>項目</td>
374
+
375
+ <td>項目</td>
376
+
377
+ </tr>
378
+
379
+ <tr>
380
+
381
+ <td>項目</td>
382
+
383
+ <td>項目</td>
384
+
385
+ <td>項目</td>
386
+
387
+ <td>項目</td>
388
+
389
+ <td>項目</td>
390
+
391
+ <td>項目</td>
392
+
393
+ <td>項目</td>
394
+
395
+ <td>項目</td>
396
+
397
+ </tr>
398
+
399
+
400
+
401
+ </table>
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
412
+
413
+ <script type="text/javascript" src="https://zurb.com/playground/projects/responsive-tables/responsive-tables.js"></script>
414
+
415
+
416
+
417
+ </body>
418
+
419
+ </html>
420
+
421
+
422
+
423
+ ```
424
+
425
+ 上記のcss記述で実現できました。
426
+
427
+ アドバイスいただきありがとうございました。

1

実現したいアニメーションの画面の画像を追加

2018/08/07 03:07

投稿

Tatsurou
Tatsurou

スコア81

test CHANGED
File without changes
test CHANGED
@@ -8,9 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- ![イメージ説明](8a8572051549dc672f5ff4830cf59cb0.png)
12
-
13
- [実際の画面](https://www.google.co.jp/search?q=%E3%83%97%E3%83%AD%E9%87%8E%E7%90%83&rlz=1C5CHFA_enJP708JP708&oq=%E3%83%97%E3%83%AD%E9%87%8E%E7%90%83&aqs=chrome..69i57j69i65l3j69i61l2.3041j1j7&sourceid=chrome&ie=UTF-8#sie=t;/m/03q7k5;4;/m/012xwy;st;fp;1)
11
+ ![実現した画面](6ec36c472efffbf8b84c1ea360ff0b14.png)
14
12
 
15
13
 
16
14