그것은 당신이 추가 세포가 이전 또는 이후에 올 것인지 달려
$output .= "
<tr>
<td class='signal-list'><a href data-toggle='modal' data-target='#showSignal$id'>$id</a></td>
<td class='signal-list'>$date_added</td>
<td class='signal-list'>$pr</td>
<td>$ac</td>
<td class='signal-list'>$entr</td>
<td>$dir</td>
<td>$clo</td>
<td>$p_l</td>
</tr>
";
}
$output .= '</table>';
}
echo $output;
내가 $ 출력 내부에 아래로 아래에이 코드를 추가 할 : 여기
코드입니다 기존 셀,하지만 당신이해야 할 일은
$output
이외의
<tr>
을 가져 와서
echo
을 변경하여 012에 추가하면됩니다.변수는
.=
입니다.
다음에 추가 할 내용을 보여주는 예가 있지만 Existing cells
과 New cells
을 미리 바꿔 둘 수 있습니다. 구조는 여전히 정확합니다.
<?php
// Start the table and table row - note that you do not use `.=` here
$output = '<table><tr>';
// Existing cells
$output .= "
<td class='signal-list'><a href data-toggle='modal' data-target='#showSignal$id'>$id</a></td>
<td class='signal-list'>$date_added</td>
<td class='signal-list'>$pr</td>
<td>$ac</td>
<td class='signal-list'>$entr</td>
<td>$dir</td>
<td>$clo</td>
<td>$p_l</td>
";
// New cells
if($status == 'Profit') {
$output .= "<td class='signal-list'><p class='label label-success'>PROFIT</p></td>";
} elseif($status == 'Loss') {
$output .= "<td class='signal-list'><p class='label label-danger'> LOSS </p></td>";
} else {
$output .= "<td class='signal-list'><p class='label label-primary'> LIVE </p></td>";
}
// End the table row and table itself
$output .= '</tr></table>';
echo $output;
희망이 있습니다. :)
어쩌면 나는 충분히 명확하지 않았다. 나는이 코드를 현재 $ 출력 안에 새것이 아니고 HTML 표 안에 넣고 싶다. –
죄송합니다, 사용하고 있습니다. = 같은 문자열을 사용하는 것은 새로운 것이 아닙니다. 은 $ output = $ output과 같습니다. "무언가" – cmnardi
오우 치, 내 나쁜 .. 미안해, 고마워! –