Posted By

lifewishes on 10/19/10


Tagged

cakephp grid


Versions (?)

cakephp grid example


 / Published in: PHP
 

cakephp grid example

  1. <?php
  2. // echo $html->css('default');
  3. ?>
  4. <style type="text/css">
  5. table
  6. {
  7. border-collapse: collapse;
  8. }
  9.  
  10. th
  11. {
  12. background-color: #00A300;
  13. color: #ffffff;
  14. }
  15.  
  16. tr
  17. {
  18. background-color: #D4FFA8;
  19. border-top: 1px solid #000000;
  20. border-bottom: 1px solid #000000;
  21. }
  22. </style>
  23.  
  24. <table>
  25.  
  26. <?php
  27.  
  28. echo $html->tableHeaders(
  29. 'Product ID',
  30. 'Product',
  31. 'Description',
  32. 'Price'
  33. )
  34. );
  35.  
  36. foreach($data as $product)
  37. {
  38. echo $html->tableCells(
  39. $product['Product']['product_id'],
  40. $product['Product']['product_name'],
  41. $product['Product']['product_desc'],
  42. $product['Product']['product_price']
  43. )
  44. )
  45. );
  46. }
  47. ?>
  48.  
  49. </table>

Report this snippet  

You need to login to post a comment.