【发布时间】:2015-08-31 07:41:24
【问题描述】:
我在 php 上有这个脚本,我需要从中自动创建表
foreach ( $GetJobResult->Components->Component as $component_index => $component ) {
$quote_title = ($component_index + 1) . ') ' . $component->Title . "-Machine :\r\n";
if (isset ( $component->Paper->Family )) {
if (isset ( $component->Paper->Type ) && isset ( $component->Paper->Color )) {
if ($component->Ink->FrontColors == '0') {
$quote_impression = "sans impression\r\n";
}
$getPaperInfoResult = $ws->getPaperInfo ( $component->Paper->Family, $component->Paper->Type );
foreach ( $getPaperInfoResult->PapFamType as $paper_index => $paperinfo ) {
if (($paperinfo->Ccoul == $component->Paper->Color) && ($paperinfo->Gramm == $component->Paper->Weight)) {
$quote_support = $paperinfo->Lfam . ' - ' . $paperinfo->Lcoul . ' - ' . $paperinfo->Gramm . ' g/m2' . "\n";
$quote_impression = $component->Ink->FrontColors . ' Couleur(s) ( ' . $component->Ink->FrontColorDesc . ') au recto / ' . $component->Ink->BackColors . ' Couleur(s)' . ' ( ' . $component->Ink->BackColorDesc . ' ) ' . "\n";
break;
}
// $quote_desc[]= $getPaperInfoResult->PapFamType [$component_index + 1]->Lfam . ' - ' . $getPaperInfoResult->PapFamType [$component_index + 1]->Lcoul . ' - ' . $getPaperInfoResult->PapFamType [$component_index + 1]->Gramm . ' g/m2' . "\n";
}
}
$row++; $col++;
$tbl = $p->add_table_cell($tbl, $col, $row, $quote_title, $opttitrecontact);
$imp_text_element1.=$quote_title."-Support : ".$quote_support."-Impression : ".$quote_impression;
}
}
在每个单元格中完成表格数据并跳过放置数据的一个单元格,所以我只需要包含数据的表格我该怎么做。
【问题讨论】:
-
欢迎来到 Stack Overflow。您的问题可以使用更多细节。请对其进行编辑并包含您看到的任何错误,或者可能是您获得的结果数据与您尝试获得的数据的一些示例。
-
我做了我的脚本,但结果不是表格包含不同单元格中的数据