-1
이것은 일반적인 질문이며 특정 프로그래밍 코드와 아무런 관련이 없습니다. 그러나 이것은 간단하게 들리지만, 알아낼 수는 없습니다.다른 열의 테이블 형식 테이블
HTML 표 :
Col A Col B
testA testB
testA testB
testA
때문에 HTML 코드는 것 외모 내가 같을 것이다 테이블을 생성 할이에서
id | name | type
1 | testA | A
2 | testA | A
3 | testA | A
4 | testB | B
5 | testB | B
:
다음과 같은 DB 구조를주기 like :
<table>
<tr>
<th>Col A</th>
<th>Col B</th>
</tr>
<tr>
<td>testA</td>
<td>testB</td>
<tr>
<tr>
<td>testA</td>
<td>testB</td>
<tr>
<tr>
<td>testA</td>
<td></td>
<tr>
<table>
인라인 colspan
및 rowspan
을 사용하는 솔루션이 있으면 환영합니다.
우아한 해결책을 찾을 수 없습니다.
// Not Working:
$elements = array('doc'=>array(),'pub'=>array());
$db = new SQLite3('sqlite3.db');
$results = $db->query('SELECT * FROM l ORDER BY type;');
while ($row = $results->fetchArray(SQLITE3_ASSOC)) {
array_push($elements[$row['type']], $row);
}
$fi = array();
for ($i=0;$i<count($elements['pub'])+count($elements['doc']);$i++){
if ($i%2==0){
array_push($fi,$elements['pub'][floor($i/2)]);
}else{
array_push($fi,$elements['doc'][floor($i/2)]);
}
}
var_dump($fi);
exit();
// This is not working because most of the times
// the count of elements from type A
// is NOT equal to elements of type B.
당신이 나에게 더 많은 정보 –
어떤 더 많은 정보를 제공 할 수 있습니까? – JonnieJS
ColB 란 무엇이며 colB가 입력 된 경우 ColB는 무엇이며 저장되는 곳은 colB입니다. –