tazdevil Posted February 1, 2008 Share Posted February 1, 2008 Please can someone help me... I am a complete PHP newbie! I need to make the header of the following PHP code have a header row colour of bgcolor="#23AA49" Where & how do I add this to the following code? thanks function phptemplate_cart_review_form(&$form) { $f =& $form['cart']; $header = array(t('License Qty'), t('Product'), '', t('Price (each)'), '', '', '', t('Subtotal'), ''); $rows = array(); if ($f['items']) { foreach ($f['items'] as $key => $line) { if (is_numeric($key)) { $rows[] = array( $line['qty']['#value'], $line['item']['#value']->title, '', array('data' => payment_format($line['price']['#value']), 'align' => 'left'), '', '', array('data' => $line['Calculation']['#value'], 'align' => 'left'), array('data' => payment_format($line['subtotal']['#value']), 'align' => 'left'), $line['options']['#value'] ); } } } $rows[] = array('', '', '','', '', ''); foreach ($f['totals'] as $id => $line) { if (is_numeric($id)) { $rows[] = array( '', '', '', '', '', "<b>{$line['#title']}</b>", '', array('data' => payment_format($line['#value']), 'align' => 'left'), '' ); } } $content .= theme('table', $header, $rows); return theme('box', t('Order Summary'), $content); } Quote Link to comment https://forums.phpfreaks.com/topic/88949-add-bgcolor-to-header-newbie-help/ Share on other sites More sharing options...
kts Posted February 1, 2008 Share Posted February 1, 2008 It won't be there, you need to find where the HTML output is... find where the td is and then put it there Quote Link to comment https://forums.phpfreaks.com/topic/88949-add-bgcolor-to-header-newbie-help/#findComment-455577 Share on other sites More sharing options...
nickdrums Posted February 1, 2008 Share Posted February 1, 2008 Really hard to understand what's going on in this code - there must be some serious use of classes I guess. My best suggestion is to look at this line: "<b>{$line['#title']}</b>", And insert the formatting there, so perhaps something like: "<span style=\"font-weight: bold; bgcolor: #23AA49\">{$line['#title']}</span>", Hope this helps ... Quote Link to comment https://forums.phpfreaks.com/topic/88949-add-bgcolor-to-header-newbie-help/#findComment-455581 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.