Php 如何将我的桌子的td与th对齐?
表格的第一列是个人数据,第二部分是关于员工的操作。我想在行中创建单元格。它不需要对所有员工的数据进行有条件的重复,但是如果我设置了条件,就会导致这个问题。 此信息是tr的一部分Php 如何将我的桌子的td与th对齐?,php,codeigniter,view,foreach,Php,Codeigniter,View,Foreach,表格的第一列是个人数据,第二部分是关于员工的操作。我想在行中创建单元格。它不需要对所有员工的数据进行有条件的重复,但是如果我设置了条件,就会导致这个问题。 此信息是tr的一部分 <?php if( !empty($obtOpera)) { foreach($obtOpera as $fi) { if( !empty($consult) ) { foreach($consult as $fil) {
<?php
if( !empty($obtOpera)) {
foreach($obtOpera as $fi) {
if( !empty($consult) ) {
foreach($consult as $fil) {
if($fil->operation==$fi->operation && $fila->cveEmp ==$fil->cveEmp) {
echo "<td class='$fil->color'<h4> $fil->operation</h4> X";
}#Close if
elseif ($fi->operation!=$fil->operation) {
echo "<td>N/A</td>";
}#Close Else if
}#Close consult
}#Close if that compare operation
}#Close foreach fi
}#Close if de obtOpera ?>
您缺少foreach循环中的结束
应该是:
echo "<td class='$fil->color'<h4> $fil->operation</h4> X</td>";
echo“操作X”;
您缺少foreach循环中的结束
应该是:
echo "<td class='$fil->color'<h4> $fil->operation</h4> X</td>";
echo“操作X”;
以下是我问题的答案:
<?php
if(!empty($obtOperation))
{
foreach($obtOperation as $fi)
{
$this->load->model('Reports_model');
$fil=$this->Reports_model->consult($fil->idBlock, $date1, $date2, $fila->cveEmp, $fi->idOperation);
if(!empty($fil))
{
foreach($fil as $fil)
{
if($fi->idOperation==$fil->idOperation)
{
echo "<td class='$fil->color'><h4> $fil->operation</h4> X</td>";
}#close else
}#close consult
}
else
{
echo "<td>N/A</td>";
}#Close if
}#Close foreach fi
}#Closeif de obtOperation
?>
这里是我问题的答案:
<?php
if(!empty($obtOperation))
{
foreach($obtOperation as $fi)
{
$this->load->model('Reports_model');
$fil=$this->Reports_model->consult($fil->idBlock, $date1, $date2, $fila->cveEmp, $fi->idOperation);
if(!empty($fil))
{
foreach($fil as $fil)
{
if($fi->idOperation==$fil->idOperation)
{
echo "<td class='$fil->color'><h4> $fil->operation</h4> X</td>";
}#close else
}#close consult
}
else
{
echo "<td>N/A</td>";
}#Close if
}#Close foreach fi
}#Closeif de obtOperation
?>
是的,我知道,但我继续处理相同的问题,谢谢:)是的,我知道,但我继续处理相同的问题,谢谢:)