質問編集履歴
2
htmlとcssの全コードを記載しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,6 +6,754 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
以下に、htmlとcssの全コードを示します。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
```html
|
14
|
+
|
15
|
+
<div class="header">
|
16
|
+
|
17
|
+
<h1 class="title">
|
18
|
+
|
19
|
+
第7回しゅが研 リーグ表
|
20
|
+
|
21
|
+
</h1>
|
22
|
+
|
23
|
+
</div>
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
<div class="main">
|
28
|
+
|
29
|
+
<div class="league-table">
|
30
|
+
|
31
|
+
<table border="2" bordercolor="black" style="border-collapse: collapse">
|
32
|
+
|
33
|
+
<tr class="top-tr">
|
34
|
+
|
35
|
+
<th class="rank-title">順位</th>
|
36
|
+
|
37
|
+
<th class="member-title">メンバー</th>
|
38
|
+
|
39
|
+
<td class="opponent-name"></td>
|
40
|
+
|
41
|
+
<td class="opponent-name"></td>
|
42
|
+
|
43
|
+
<td class="opponent-name"></td>
|
44
|
+
|
45
|
+
<td class="opponent-name"></td>
|
46
|
+
|
47
|
+
<td class="opponent-name"></td>
|
48
|
+
|
49
|
+
<td class="opponent-name"></td>
|
50
|
+
|
51
|
+
<td class="opponent-name"></td>
|
52
|
+
|
53
|
+
<td class="opponent-name"></td>
|
54
|
+
|
55
|
+
<td class="opponent-name"></td>
|
56
|
+
|
57
|
+
<td class="opponent-name"></td>
|
58
|
+
|
59
|
+
<th class="win-count-title">勝</th>
|
60
|
+
|
61
|
+
<th class="lose-count-title">負</th>
|
62
|
+
|
63
|
+
<th class="sb-count-title">SB</th>
|
64
|
+
|
65
|
+
</tr>
|
66
|
+
|
67
|
+
<tr class="result-cells">
|
68
|
+
|
69
|
+
<td class="rank"></td>
|
70
|
+
|
71
|
+
<td class="self-name"></td>
|
72
|
+
|
73
|
+
<td></td>
|
74
|
+
|
75
|
+
<td></td>
|
76
|
+
|
77
|
+
<td></td>
|
78
|
+
|
79
|
+
<td></td>
|
80
|
+
|
81
|
+
<td></td>
|
82
|
+
|
83
|
+
<td></td>
|
84
|
+
|
85
|
+
<td></td>
|
86
|
+
|
87
|
+
<td></td>
|
88
|
+
|
89
|
+
<td></td>
|
90
|
+
|
91
|
+
<td></td>
|
92
|
+
|
93
|
+
<td class="win-count"></td>
|
94
|
+
|
95
|
+
<td class="lose-count"></td>
|
96
|
+
|
97
|
+
<td class="sb-count"></td>
|
98
|
+
|
99
|
+
</tr>
|
100
|
+
|
101
|
+
<tr class="result-cells">
|
102
|
+
|
103
|
+
<td class="rank"></td>
|
104
|
+
|
105
|
+
<td class="self-name"></td>
|
106
|
+
|
107
|
+
<td></td>
|
108
|
+
|
109
|
+
<td></td>
|
110
|
+
|
111
|
+
<td></td>
|
112
|
+
|
113
|
+
<td></td>
|
114
|
+
|
115
|
+
<td></td>
|
116
|
+
|
117
|
+
<td></td>
|
118
|
+
|
119
|
+
<td></td>
|
120
|
+
|
121
|
+
<td></td>
|
122
|
+
|
123
|
+
<td></td>
|
124
|
+
|
125
|
+
<td></td>
|
126
|
+
|
127
|
+
<td class="win-count"></td>
|
128
|
+
|
129
|
+
<td class="lose-count"></td>
|
130
|
+
|
131
|
+
<td class="sb-count"></td>
|
132
|
+
|
133
|
+
</tr>
|
134
|
+
|
135
|
+
<tr class="result-cells">
|
136
|
+
|
137
|
+
<td class="rank"></td>
|
138
|
+
|
139
|
+
<td class="self-name"></td>
|
140
|
+
|
141
|
+
<td></td>
|
142
|
+
|
143
|
+
<td></td>
|
144
|
+
|
145
|
+
<td></td>
|
146
|
+
|
147
|
+
<td></td>
|
148
|
+
|
149
|
+
<td></td>
|
150
|
+
|
151
|
+
<td></td>
|
152
|
+
|
153
|
+
<td></td>
|
154
|
+
|
155
|
+
<td></td>
|
156
|
+
|
157
|
+
<td></td>
|
158
|
+
|
159
|
+
<td></td>
|
160
|
+
|
161
|
+
<td class="win-count"></td>
|
162
|
+
|
163
|
+
<td class="lose-count"></td>
|
164
|
+
|
165
|
+
<td class="sb-count"></td>
|
166
|
+
|
167
|
+
</tr>
|
168
|
+
|
169
|
+
<tr class="result-cells">
|
170
|
+
|
171
|
+
<td class="rank"></td>
|
172
|
+
|
173
|
+
<td class="self-name"></td>
|
174
|
+
|
175
|
+
<td></td>
|
176
|
+
|
177
|
+
<td></td>
|
178
|
+
|
179
|
+
<td></td>
|
180
|
+
|
181
|
+
<td></td>
|
182
|
+
|
183
|
+
<td></td>
|
184
|
+
|
185
|
+
<td></td>
|
186
|
+
|
187
|
+
<td></td>
|
188
|
+
|
189
|
+
<td></td>
|
190
|
+
|
191
|
+
<td></td>
|
192
|
+
|
193
|
+
<td></td>
|
194
|
+
|
195
|
+
<td class="win-count"></td>
|
196
|
+
|
197
|
+
<td class="lose-count"></td>
|
198
|
+
|
199
|
+
<td class="sb-count"></td>
|
200
|
+
|
201
|
+
</tr>
|
202
|
+
|
203
|
+
<tr class="result-cells">
|
204
|
+
|
205
|
+
<td class="rank"></td>
|
206
|
+
|
207
|
+
<td class="self-name"></td>
|
208
|
+
|
209
|
+
<td></td>
|
210
|
+
|
211
|
+
<td></td>
|
212
|
+
|
213
|
+
<td></td>
|
214
|
+
|
215
|
+
<td></td>
|
216
|
+
|
217
|
+
<td></td>
|
218
|
+
|
219
|
+
<td></td>
|
220
|
+
|
221
|
+
<td></td>
|
222
|
+
|
223
|
+
<td></td>
|
224
|
+
|
225
|
+
<td></td>
|
226
|
+
|
227
|
+
<td></td>
|
228
|
+
|
229
|
+
<td class="win-count"></td>
|
230
|
+
|
231
|
+
<td class="lose-count"></td>
|
232
|
+
|
233
|
+
<td class="sb-count"></td>
|
234
|
+
|
235
|
+
</tr>
|
236
|
+
|
237
|
+
<tr class="result-cells">
|
238
|
+
|
239
|
+
<td class="rank"></td>
|
240
|
+
|
241
|
+
<td class="self-name"></td>
|
242
|
+
|
243
|
+
<td></td>
|
244
|
+
|
245
|
+
<td></td>
|
246
|
+
|
247
|
+
<td></td>
|
248
|
+
|
249
|
+
<td></td>
|
250
|
+
|
251
|
+
<td></td>
|
252
|
+
|
253
|
+
<td></td>
|
254
|
+
|
255
|
+
<td></td>
|
256
|
+
|
257
|
+
<td></td>
|
258
|
+
|
259
|
+
<td></td>
|
260
|
+
|
261
|
+
<td></td>
|
262
|
+
|
263
|
+
<td class="win-count"></td>
|
264
|
+
|
265
|
+
<td class="lose-count"></td>
|
266
|
+
|
267
|
+
<td class="sb-count"></td>
|
268
|
+
|
269
|
+
</tr>
|
270
|
+
|
271
|
+
<tr class="result-cells">
|
272
|
+
|
273
|
+
<td class="rank"></td>
|
274
|
+
|
275
|
+
<td class="self-name"></td>
|
276
|
+
|
277
|
+
<td></td>
|
278
|
+
|
279
|
+
<td></td>
|
280
|
+
|
281
|
+
<td></td>
|
282
|
+
|
283
|
+
<td></td>
|
284
|
+
|
285
|
+
<td></td>
|
286
|
+
|
287
|
+
<td></td>
|
288
|
+
|
289
|
+
<td></td>
|
290
|
+
|
291
|
+
<td></td>
|
292
|
+
|
293
|
+
<td></td>
|
294
|
+
|
295
|
+
<td></td>
|
296
|
+
|
297
|
+
<td class="win-count"></td>
|
298
|
+
|
299
|
+
<td class="lose-count"></td>
|
300
|
+
|
301
|
+
<td class="sb-count"></td>
|
302
|
+
|
303
|
+
</tr>
|
304
|
+
|
305
|
+
<tr class="result-cells">
|
306
|
+
|
307
|
+
<td class="rank"></td>
|
308
|
+
|
309
|
+
<td class="self-name"></td>
|
310
|
+
|
311
|
+
<td></td>
|
312
|
+
|
313
|
+
<td></td>
|
314
|
+
|
315
|
+
<td></td>
|
316
|
+
|
317
|
+
<td></td>
|
318
|
+
|
319
|
+
<td></td>
|
320
|
+
|
321
|
+
<td></td>
|
322
|
+
|
323
|
+
<td></td>
|
324
|
+
|
325
|
+
<td></td>
|
326
|
+
|
327
|
+
<td></td>
|
328
|
+
|
329
|
+
<td></td>
|
330
|
+
|
331
|
+
<td class="win-count"></td>
|
332
|
+
|
333
|
+
<td class="lose-count"></td>
|
334
|
+
|
335
|
+
<td class="sb-count"></td>
|
336
|
+
|
337
|
+
</tr>
|
338
|
+
|
339
|
+
<tr class="result-cells">
|
340
|
+
|
341
|
+
<td class="rank"></td>
|
342
|
+
|
343
|
+
<td class="self-name"></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
|
+
<td></td>
|
358
|
+
|
359
|
+
<td></td>
|
360
|
+
|
361
|
+
<td></td>
|
362
|
+
|
363
|
+
<td></td>
|
364
|
+
|
365
|
+
<td class="win-count"></td>
|
366
|
+
|
367
|
+
<td class="lose-count"></td>
|
368
|
+
|
369
|
+
<td class="sb-count"></td>
|
370
|
+
|
371
|
+
</tr>
|
372
|
+
|
373
|
+
<tr class="result-cells">
|
374
|
+
|
375
|
+
<td class="rank"></td>
|
376
|
+
|
377
|
+
<td class="self-name"></td>
|
378
|
+
|
379
|
+
<td></td>
|
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
|
+
<td></td>
|
398
|
+
|
399
|
+
<td class="win-count"></td>
|
400
|
+
|
401
|
+
<td class="lose-count"></td>
|
402
|
+
|
403
|
+
<td class="sb-count"></td>
|
404
|
+
|
405
|
+
</tr>
|
406
|
+
|
407
|
+
</table>
|
408
|
+
|
409
|
+
</div>
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
<div class="member-list">
|
414
|
+
|
415
|
+
<h2 class="member-list-title">
|
416
|
+
|
417
|
+
メンバー紹介
|
418
|
+
|
419
|
+
</h2>
|
420
|
+
|
421
|
+
<table border="2" bordercolor="black" style="border-collapse: collapse">
|
422
|
+
|
423
|
+
<tr class="member-info">
|
424
|
+
|
425
|
+
<th class="member">メンバー</th>
|
426
|
+
|
427
|
+
<th class="account">アカウント</th>
|
428
|
+
|
429
|
+
<th class="achievement">実績</th>
|
430
|
+
|
431
|
+
</tr>
|
432
|
+
|
433
|
+
<tr class="member-introduction">
|
434
|
+
|
435
|
+
<td></td>
|
436
|
+
|
437
|
+
<td></td>
|
438
|
+
|
439
|
+
<td></td>
|
440
|
+
|
441
|
+
</tr>
|
442
|
+
|
443
|
+
<tr class="member-introduction">
|
444
|
+
|
445
|
+
<td></td>
|
446
|
+
|
447
|
+
<td></td>
|
448
|
+
|
449
|
+
<td></td>
|
450
|
+
|
451
|
+
</tr>
|
452
|
+
|
453
|
+
<tr class="member-introduction">
|
454
|
+
|
455
|
+
<td></td>
|
456
|
+
|
457
|
+
<td></td>
|
458
|
+
|
459
|
+
<td></td>
|
460
|
+
|
461
|
+
</tr>
|
462
|
+
|
463
|
+
<tr class="member-introduction">
|
464
|
+
|
465
|
+
<td></td>
|
466
|
+
|
467
|
+
<td></td>
|
468
|
+
|
469
|
+
<td></td>
|
470
|
+
|
471
|
+
</tr>
|
472
|
+
|
473
|
+
<tr class="member-introduction">
|
474
|
+
|
475
|
+
<td></td>
|
476
|
+
|
477
|
+
<td></td>
|
478
|
+
|
479
|
+
<td></td>
|
480
|
+
|
481
|
+
</tr>
|
482
|
+
|
483
|
+
<tr class="member-introduction">
|
484
|
+
|
485
|
+
<td></td>
|
486
|
+
|
487
|
+
<td></td>
|
488
|
+
|
489
|
+
<td></td>
|
490
|
+
|
491
|
+
</tr>
|
492
|
+
|
493
|
+
<tr class="member-introduction">
|
494
|
+
|
495
|
+
<td></td>
|
496
|
+
|
497
|
+
<td></td>
|
498
|
+
|
499
|
+
<td></td>
|
500
|
+
|
501
|
+
</tr>
|
502
|
+
|
503
|
+
<tr class="member-introduction">
|
504
|
+
|
505
|
+
<td></td>
|
506
|
+
|
507
|
+
<td></td>
|
508
|
+
|
509
|
+
<td></td>
|
510
|
+
|
511
|
+
</tr>
|
512
|
+
|
513
|
+
<tr class="member-introduction">
|
514
|
+
|
515
|
+
<td></td>
|
516
|
+
|
517
|
+
<td></td>
|
518
|
+
|
519
|
+
<td></td>
|
520
|
+
|
521
|
+
</tr>
|
522
|
+
|
523
|
+
<tr class="member-introduction">
|
524
|
+
|
525
|
+
<td></td>
|
526
|
+
|
527
|
+
<td></td>
|
528
|
+
|
529
|
+
<td></td>
|
530
|
+
|
531
|
+
</tr>
|
532
|
+
|
533
|
+
</table>
|
534
|
+
|
535
|
+
</div>
|
536
|
+
|
537
|
+
</div>
|
538
|
+
|
539
|
+
</div>
|
540
|
+
|
541
|
+
```
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
```css
|
546
|
+
|
547
|
+
.header {
|
548
|
+
|
549
|
+
margin: 20px;
|
550
|
+
|
551
|
+
}
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
.main {
|
556
|
+
|
557
|
+
margin: 20px;
|
558
|
+
|
559
|
+
}
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
.league-table {
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
}
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
table {
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
}
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
.top-tr {
|
580
|
+
|
581
|
+
height: 30px;
|
582
|
+
|
583
|
+
}
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
.rank-title {
|
588
|
+
|
589
|
+
width: 50px;
|
590
|
+
|
591
|
+
text-align: center;
|
592
|
+
|
593
|
+
background-color: #FFFFAA;
|
594
|
+
|
595
|
+
}
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
.member-title {
|
600
|
+
|
601
|
+
width: 80px;
|
602
|
+
|
603
|
+
text-align: center;
|
604
|
+
|
605
|
+
background-color: #EEEEEE;
|
606
|
+
|
607
|
+
}
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
.self-name {
|
612
|
+
|
613
|
+
height:40px ;
|
614
|
+
|
615
|
+
background-color: #EEEEEE;
|
616
|
+
|
617
|
+
}
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
.opponent-name {
|
622
|
+
|
623
|
+
width: 60px;
|
624
|
+
|
625
|
+
background-color: #EEEEEE;
|
626
|
+
|
627
|
+
}
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
.win-count-title {
|
632
|
+
|
633
|
+
width: 50px;
|
634
|
+
|
635
|
+
text-align: center;
|
636
|
+
|
637
|
+
background-color: #FFD5EC;
|
638
|
+
|
639
|
+
}
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
.lose-count-title {
|
644
|
+
|
645
|
+
width: 50px;
|
646
|
+
|
647
|
+
text-align: center;
|
648
|
+
|
649
|
+
background-color: #D9E5FF;
|
650
|
+
|
651
|
+
}
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
.sb-count-title {
|
656
|
+
|
657
|
+
width: 50px;
|
658
|
+
|
659
|
+
text-align: center;
|
660
|
+
|
661
|
+
background-color: #F3FFD8;
|
662
|
+
|
663
|
+
}
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
.win-count {
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
}
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
.lose-count {
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
}
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
.result-cells {
|
684
|
+
|
685
|
+
height:40px ;
|
686
|
+
|
687
|
+
}
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
.member-list {
|
692
|
+
|
693
|
+
margin-top: 30px;
|
694
|
+
|
695
|
+
}
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
.member-list-title {
|
700
|
+
|
701
|
+
margin-bottom: 10px;
|
702
|
+
|
703
|
+
}
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
.member-info {
|
708
|
+
|
709
|
+
height: 30px;
|
710
|
+
|
711
|
+
}
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
.member {
|
716
|
+
|
717
|
+
width: 100px;
|
718
|
+
|
719
|
+
text-align: center;
|
720
|
+
|
721
|
+
background-color: #EEEEEE;
|
722
|
+
|
723
|
+
}
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
.account {
|
728
|
+
|
729
|
+
width: 150px;
|
730
|
+
|
731
|
+
text-align: center;
|
732
|
+
|
733
|
+
}
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
.achievement {
|
738
|
+
|
739
|
+
width: 500px;
|
740
|
+
|
741
|
+
text-align: center;
|
742
|
+
|
743
|
+
}
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
.member-introduction {
|
748
|
+
|
749
|
+
height: 30px;
|
750
|
+
|
751
|
+
}
|
752
|
+
|
753
|
+
```
|
754
|
+
|
755
|
+
|
756
|
+
|
9
757
|
自分vs自分のところに斜線を引きたいのですが、tdごと斜線を引くと手間がかかります。
|
10
758
|
|
11
759
|
そこで、テーブルの特定箇所に対角線を引く方法を調べました。
|
@@ -32,7 +780,7 @@
|
|
32
780
|
|
33
781
|
|
34
782
|
|
35
|
-
```
|
783
|
+
```css
|
36
784
|
|
37
785
|
background: linear-gradient(45deg, transparent, transparent 49%, black 49%, black 51%, transparent 51%, transparent);
|
38
786
|
|
1
イメージ図を掲載しました。調べた内容、試したコード、結果の画像を示しました。解決できなかったことを具体的に最後に書きました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,11 +1,53 @@
|
|
1
|
-
# htmlのテーブルで対角線
|
1
|
+
# htmlのテーブルで対角線を引く
|
2
2
|
|
3
3
|
htmlで総当たりリーグ戦のテーブルを作成しています。以下は、現在のレイアウトです。
|
4
4
|
|
5
|
-
|
5
|
+
![イメージ説明](55132975c18c065dceb0cdf280118e19.png)
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
自分vs自分のところに斜線を引きたいのですが、tdごと
|
9
|
+
自分vs自分のところに斜線を引きたいのですが、tdごと斜線を引くと手間がかかります。
|
10
10
|
|
11
|
-
そこで、
|
11
|
+
そこで、テーブルの特定箇所に対角線を引く方法を調べました。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
# 調べた内容
|
16
|
+
|
17
|
+
・CSSで斜線を引く方法:表の空セルなど任意のHTML要素に
|
18
|
+
|
19
|
+
https://allabout.co.jp/gm/gc/457196/3/
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
CSSで斜線を引く方法を現役デザイナーが解説【初心者向け】
|
24
|
+
|
25
|
+
・https://techacademy.jp/magazine/25188
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
# 試したコード
|
30
|
+
|
31
|
+
テーブルに斜線を引くには、以下のコードが使えると考えました。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
```html
|
36
|
+
|
37
|
+
background: linear-gradient(45deg, transparent, transparent 49%, black 49%, black 51%, transparent 51%, transparent);
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
しかし、期待しない場所に太すぎる線が出ました。
|
44
|
+
|
45
|
+
![イメージ説明](5167ea3e6de7e76495dafd4f9c8698c5.png)
|
46
|
+
|
47
|
+
%の値を変えたりしましたが、色のグラデーションが出て期待通りの対角線は実現しませんでした。
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
# 対角線の起点と終点を指定したい
|
52
|
+
|
53
|
+
対角線の起点と終点の位置、色や太さを指定するには、どうすればよいでしょうか?
|