質問編集履歴

4

修正

2020/02/14 23:51

投稿

dedede_daiou
dedede_daiou

スコア10

test CHANGED
File without changes
test CHANGED
@@ -234,15 +234,15 @@
234
234
 
235
235
  for ($i = 0; $i < count($array); $i++) {
236
236
 
237
+ $Table.="<tr>\n";
238
+
239
+ $Table.='<td rowspan="1">'.?????.'</td>\n';
240
+
241
+ $Table.="<td>".?????."</td>\n";
242
+
237
243
  $Table.="<tr>/n";
238
244
 
239
- $Table.='<td rowspan="1">'.?????.'</td>/n';
240
-
241
- $Table.="<td>".?????."</td>/n";
245
+ $Table.="<td>".?????."</td>\n";
242
-
243
- $Table.="<tr>/n";
244
-
245
- $Table.="<td>".?????."</td>/n";
246
246
 
247
247
  $Table.="</td>";
248
248
 

3

更新

2020/02/14 23:51

投稿

dedede_daiou
dedede_daiou

スコア10

test CHANGED
@@ -1 +1 @@
1
- 2次元配列に格納された値をTableに出力する方法
1
+ 更新2次元配列に格納された値をTableに出力する方法
test CHANGED
@@ -236,21 +236,17 @@
236
236
 
237
237
  $Table.="<tr>/n";
238
238
 
239
- for ($col = 0; $col < count($array[0]); $col++) {
240
-
241
- $Table.='<td rowspan="1">'.?????.'</td>/n';
239
+ $Table.='<td rowspan="1">'.?????.'</td>/n';
242
-
240
+
243
- $Table.="<td>".?????."</td>/n";
241
+ $Table.="<td>".?????."</td>/n";
244
-
242
+
245
- $Table.="<tr>/n";
243
+ $Table.="<tr>/n";
246
-
244
+
247
- $Table.="<td>".?????."</td>/n";
245
+ $Table.="<td>".?????."</td>/n";
248
-
246
+
249
- $Table.="</td>";
247
+ $Table.="</td>";
250
-
248
+
251
- }
249
+ }
252
-
253
- }
254
250
 
255
251
  $Table.="</Table>";
256
252
 

2

追記

2020/02/14 23:48

投稿

dedede_daiou
dedede_daiou

スコア10

test CHANGED
File without changes
test CHANGED
@@ -217,3 +217,43 @@
217
217
  array ( 0 => array ( 0 => 'https://test/p001/', 1 => 'p001.png', 2 => '2020/02/11', 3 => '食パン', 4 => '小麦粉', 5 => '卵', ), 1 => array ( 0 => 'https://test/p002/', 1 => 'p002.png', 2 => '2020/02/11', 3 => 'あんパン', 4 => '小豆', 5 => '小麦粉', ), 2 => array ( 0 => 'https://test/p003/', 1 => 'p003.png', 2 => '2020/02/12', 3 => 'ジャムパン', 4 => 'いちご', 5 => '小麦粉', ), )
218
218
 
219
219
  ```
220
+
221
+
222
+
223
+
224
+
225
+ ```php
226
+
227
+ if(count($array)!=0){
228
+
229
+
230
+
231
+ $Table = '<table border="3">\n';
232
+
233
+
234
+
235
+ for ($i = 0; $i < count($array); $i++) {
236
+
237
+ $Table.="<tr>/n";
238
+
239
+ for ($col = 0; $col < count($array[0]); $col++) {
240
+
241
+ $Table.='<td rowspan="1">'.?????.'</td>/n';
242
+
243
+ $Table.="<td>".?????."</td>/n";
244
+
245
+ $Table.="<tr>/n";
246
+
247
+ $Table.="<td>".?????."</td>/n";
248
+
249
+ $Table.="</td>";
250
+
251
+ }
252
+
253
+ }
254
+
255
+ $Table.="</Table>";
256
+
257
+ }
258
+
259
+ ```

1

追加

2020/02/14 23:19

投稿

dedede_daiou
dedede_daiou

スコア10

test CHANGED
File without changes
test CHANGED
@@ -95,3 +95,125 @@
95
95
  </table>
96
96
 
97
97
  ```
98
+
99
+
100
+
101
+ ※追記
102
+
103
+ 簡単なもので恐縮ですが、こういったイメージです。
104
+
105
+ 現在、リンク先は未定のため、リンクは設定しておりませんが
106
+
107
+ 画像をクリックするとリンク先に遷移するイメージで考えています。
108
+
109
+ ![イメージ説明](2b22db3dca5e8577d6bd872b787013e1.png)
110
+
111
+
112
+
113
+
114
+
115
+ ```html
116
+
117
+ <html>
118
+
119
+ <head></head>
120
+
121
+ <body>
122
+
123
+ <table border="0">
124
+
125
+ <tr>
126
+
127
+ <td>
128
+
129
+
130
+
131
+ <table border="3">
132
+
133
+ <tr>
134
+
135
+ <td rowspan="2"><img src="P001.png"></td>
136
+
137
+ <td>2020/02/11</td>
138
+
139
+ </tr>
140
+
141
+ <tr>
142
+
143
+ <td>食パン</td>
144
+
145
+ </tr>
146
+
147
+ </table>
148
+
149
+ </td>
150
+
151
+
152
+
153
+ <td>
154
+
155
+ <table border="3">
156
+
157
+ <tr>
158
+
159
+ <td rowspan="2"><img src="P002.png"></td>
160
+
161
+ <td>2020/02/11</td>
162
+
163
+ </tr>
164
+
165
+ <tr>
166
+
167
+ <td>あんパン</td>
168
+
169
+ </tr>
170
+
171
+ </table>
172
+
173
+ </td>
174
+
175
+
176
+
177
+ <td>
178
+
179
+ <table border="3">
180
+
181
+ <tr>
182
+
183
+ <td rowspan="2"><img src="P003.png"></td>
184
+
185
+ <td>2020/02/12</td>
186
+
187
+ </tr>
188
+
189
+ <tr>
190
+
191
+ <td>ジャムパン</td>
192
+
193
+ </tr>
194
+
195
+ </table>
196
+
197
+ </td>
198
+
199
+
200
+
201
+ </tr>
202
+
203
+ </table>
204
+
205
+ </body>
206
+
207
+ </html>
208
+
209
+
210
+
211
+ ```
212
+
213
+
214
+
215
+ ```php
216
+
217
+ array ( 0 => array ( 0 => 'https://test/p001/', 1 => 'p001.png', 2 => '2020/02/11', 3 => '食パン', 4 => '小麦粉', 5 => '卵', ), 1 => array ( 0 => 'https://test/p002/', 1 => 'p002.png', 2 => '2020/02/11', 3 => 'あんパン', 4 => '小豆', 5 => '小麦粉', ), 2 => array ( 0 => 'https://test/p003/', 1 => 'p003.png', 2 => '2020/02/12', 3 => 'ジャムパン', 4 => 'いちご', 5 => '小麦粉', ), )
218
+
219
+ ```