teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

6

オフセットずれ

2017/05/21 06:09

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -43,7 +43,7 @@
43
43
 
44
44
  <ul>
45
45
  <?php foreach ($records as $i => $record): ?>
46
- <li><?=$i."\t".implode("\t", array_map('htmlspecialchars', $record))?></li>
46
+ <li><?=($i+1)."\t".implode("\t", array_map('htmlspecialchars', $record))?></li>
47
47
  <?php endforeach; ?>
48
48
  </ul>
49
49
  ```

5

採番修正

2017/05/21 06:09

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -10,7 +10,7 @@
10
10
  $e = filter_input(INPUT_GET, 'e');
11
11
 
12
12
  // 実験用ダミーインラインデータ (実際はただのファイル名にする)
13
- $filename = 'data:text/plain;base64,' . base64_encode("1\tりんご\tapple\n2\tオレンジ\torange\n3\tバナナ\tbanana\n4\tなし\tpear\n");
13
+ $filename = 'data:text/plain;base64,' . base64_encode("りんご\tapple\nオレンジ\torange\nバナナ\tbanana\nなし\tpear\n");
14
14
 
15
15
  // SplFileObjectを使ったほうがコードがきれいになります
16
16
  $file = new File($filename, 'rb');
@@ -42,8 +42,8 @@
42
42
  </style>
43
43
 
44
44
  <ul>
45
- <?php foreach ($records as $record): ?>
45
+ <?php foreach ($records as $i => $record): ?>
46
- <li><?=implode("\t", array_map('htmlspecialchars', $record))?></li>
46
+ <li><?=$i."\t".implode("\t", array_map('htmlspecialchars', $record))?></li>
47
47
  <?php endforeach; ?>
48
48
  </ul>
49
49
  ```

4

画像差し替え

2017/05/21 06:09

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -1,4 +1,4 @@
1
- ![イメージ説明](47a1b9ba9ac520c4cd00c54f6fe53b7d.png)
1
+ ![イメージ説明](07cb363888358c8e9feffe826cb247e5.png)
2
2
 
3
3
  ```php
4
4
  <?php

3

2017/05/21 02:49

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -1,3 +1,5 @@
1
+ ![イメージ説明](47a1b9ba9ac520c4cd00c54f6fe53b7d.png)
2
+
1
3
  ```php
2
4
  <?php
3
5
 

2

2017/05/21 02:46

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -32,7 +32,7 @@
32
32
  text-indent: -1.2em;
33
33
  }
34
34
  li:before {
35
- content: "";
35
+ content: "";
36
36
  display: block;
37
37
  float: left;
38
38
  width: 1.2em;

1

変更

2017/05/21 02:45

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -24,9 +24,24 @@
24
24
  <meta charset="UTF-8">
25
25
  <title>Example</title>
26
26
 
27
+ <style>
28
+ ul {
29
+ list-style: none;
30
+ margin-left: 0;
31
+ padding-left: 1.2em;
32
+ text-indent: -1.2em;
33
+ }
34
+ li:before {
27
- <ol start="<?=key($records)+1?>">
35
+ content: "";
36
+ display: block;
37
+ float: left;
38
+ width: 1.2em;
39
+ }
40
+ </style>
41
+
42
+ <ul>
28
43
  <?php foreach ($records as $record): ?>
29
- <li><?=implode("\t", array_map('htmlspecialchars', array_slice($record, 1)))?></li>
44
+ <li><?=implode("\t", array_map('htmlspecialchars', $record))?></li>
30
45
  <?php endforeach; ?>
31
- </ol>
46
+ </ul>
32
47
  ```