gpt4 book ai didi

php - 如何将表格属性应用于所有结果

转载 作者:太空宇宙 更新时间:2023-11-04 04:53:35 24 4
gpt4 key购买 nike

我在下面粘贴我的代码......我的问题是在其他部分,标签属性没有应用,所以字段宽度正在缩小。我们应该如何使标签属性也适用于其他部分。

注意:格式要一致。

<?php 
$network_name="";
foreach($channel_summary as $c) {
$channel_str = "";
if($network_name!=$c['a']) {
$channel_str .= $c['a'].'~'.str_replace('/','surero',$c['b']).'~'.$c['c'].'~'.str_replace(' ','surero',$c['d']).'~'.date('d-M-Y', strtotime( $c['e'])).'~'.date('d-M-Y', strtotime( $c['f'])).'~'.$c['g'].'~'.$c['h'].'~'.str_replace('@','surero',$c['i']).'~'.str_replace(' ','surero',$c['j']).'~'.$c['k'];
?>
<br /><p>Network Name: <?php echo $c['a'];
$network_name=$c['a'];?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Network Contact: <?php echo $c['i'] ?> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--<input type="Submit" class= "submit" value="Network RO" onclick="javascript:NetworkROPDF(<?php echo $order_id ?>,'<?php echo $network_name;?>')" target="_blank" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
<input type="Submit" class= "submit" value="Network RO PDF" onclick="javascript:NetworkRO(<?php echo $order_id ?>,'<?php echo $network_name;?>')" target="_blank" /></p>
<table><tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
<th>F</th>
<th> G</th>
<th> H </th>
<th>&nbsp;</th>
</tr>
<tr>
<td><?php echo $c['b']."/".$c['a'] ?></td>
<td><?php echo $c['c'] ?></td>
<td><?php echo $c['d'] ?></td>
<td><?php print date('d-M-Y', strtotime( $c['e'])) ?></td>
<td><?php print date('d-M-Y', strtotime( $c['f'])) ?></td>
<td><?php echo $c['g'] ?></td>
<td><?php echo $c['h']?></td>
<td><?php echo $c['g']* $c['h']?>
<td><a href=javascript:add_price(<?php echo $order_id ?>,'<?php echo $channel_str;?>')>Add Price</a> </td>
</tr>
</table><?php } else
{
$channel_str .= $c['a'].'~'.str_replace('/','surero',$c['b']).'~'.$c['c'].'~'.str_replace(' ','surero',$c['d']).'~'.date('d-M-Y', strtotime( $c['e'])).'~'.date('d-M-Y', strtotime( $c['f'])).'~'.$c['g'].'~'.$c['h'].'~'.str_replace('@','surero',$c['i']).'~'.str_replace(' ','surero',$c['j']).'~'.$c['k'];
?><table>
<tr>
<td><?php echo $c['b']."/".$c['a'] ?></td>
<td><?php echo $c['c'] ?></td>
<td><?php echo $c['d'] ?></td>
<td><?php print date('d-M-Y', strtotime( $c['e'])) ?></td>
<td><?php print date('d-M-Y', strtotime( $c['f'])) ?></td>
<td><?php echo $c['g'] ?></td>
<td><?php echo $c['h']?></td>
<td><?php echo $c['g']* $c['h']?>
<td><a href=javascript:add_price(<?php echo $order_id ?>,'<?php echo $channel_str;?>')>Add Price</a> </td>
</tr></table>
<?php }}?>

最佳答案

问题是因为您对其他部分使用了不同的表。试试这段代码

<?php
$network_name = "";
?>
<table>
<?php
foreach ($channel_summary as $c) {
$channel_str = "";
if ($network_name != $c['a']) {

$channel_str .= $c['a'] . '~' . str_replace('/', 'surero', $c['b']) . '~' . $c['c'] . '~' . str_replace(' ', 'surero', $c['d']) . '~' . date('d-M-Y', strtotime($c['e'])) . '~' . date('d-M-Y', strtotime($c['f'])) . '~' . $c['g'] . '~' . $c['h'] . '~' . str_replace('@', 'surero', $c['i']) . '~' . str_replace(' ', 'surero', $c['j']) . '~' . $c['k'];
?>
<tr>
<td colspan="3">Network Name: <?php echo $c['a']; $network_name = $c['a']; ?></td>
<td colspan="3">Network Contact: <?php echo $c['i'] ?></td>
<td colspan="3"><input type="Submit" class= "submit" value="Network RO PDF" onclick="javascript:NetworkRO(<?php echo $order_id ?>,'<?php echo $network_name; ?>')" target="_blank" /></td>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
<th>F</th>
<th>G</th>
<th>H</th>
<th>&nbsp;</th>
</tr>
<tr>

<td><?php echo $c['b'] . "/" . $c['a'] ?></td>
<td><?php echo $c['c'] ?></td>
<td><?php echo $c['d'] ?></td>
<td><?php print date('d-M-Y', strtotime($c['e'])) ?></td>
<td><?php print date('d-M-Y', strtotime($c['f'])) ?></td>
<td><?php echo $c['g'] ?></td>
<td><?php echo $c['h'] ?></td>
<td><?php echo $c['g'] * $c['h'] ?>
<td><a href=javascript:add_price(<?php echo $order_id ?>,'<?php echo $channel_str; ?>')>Add Price</a> </td>
</tr>


<?php
} else {
$channel_str .= $c['a'] . '~' . str_replace('/', 'surero', $c['b']) . '~' . $c['c'] . '~' . str_replace(' ', 'surero', $c['d']) . '~' . date('d-M-Y', strtotime($c['e'])) . '~' . date('d-M-Y', strtotime($c['f'])) . '~' . $c['g'] . '~' . $c['h'] . '~' . str_replace('@', 'surero', $c['i']) . '~' . str_replace(' ', 'surero', $c['j']) . '~' . $c['k'];
?>
<tr>
<td><?php echo $c['b'] . "/" . $c['a'] ?></td>
<td><?php echo $c['c'] ?></td>
<td><?php echo $c['d'] ?></td>
<td><?php print date('d-M-Y', strtotime($c['e'])) ?></td>
<td><?php print date('d-M-Y', strtotime($c['f'])) ?></td>
<td><?php echo $c['g'] ?></td>
<td><?php echo $c['h'] ?></td>
<td><?php echo $c['g'] * $c['h'] ?>
<td><a href=javascript:add_price(<?php echo $order_id ?>,'<?php echo $channel_str; ?>')>Add Price</a> </td>
</tr>
<?php
}
}
?>
</table>

关于php - 如何将表格属性应用于所有结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12912477/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com