473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Create spacing between table

i have this working ----- http://pddesignstudio.com/ckc/php2

now i want to create spacing between each school how do i do it?
can anyone help mi its my first time dealing with php

PHP CODE
Expand|Select|Wrap|Line Numbers
  1.    1. <span class="style2">
  2.    2. <style type="text/css">
  3.    3. <!--
  4.    4. body, th, td, p, small {
  5.    5.     font-family:'Times New Roman',Times,serif;
  6.    6.     font-size:100%;
  7.    7.     color:#757675;
  8.    8. }
  9.    9. small {font-size:90%;}
  10.   10.  
  11.   11. td, th {
  12.   12.     background-color:#FFFFFF;
  13.   13.     border:1px solid #CCCCCC;
  14.   14.     padding:7px 20px 7px 20px;
  15.   15. }
  16.   16. th {background-color:#a5a5a5; color:#FFFFFF;}
  17.   17.  
  18.   18. h1 {font-size:120%; color:#558;}
  19.   19. h1 .sortby {color:#855;}
  20.   20. -->
  21.   21. </style>
  22.   22. </span>
  23.   23.  
  24.   24. <body>
  25.   25.  
  26.   26. <?php
  27.   27. echo '<h1><span class="sortby">'.$header.'</span></h1>
  28.   28. <table summary="List of demo fields">
  29.   29. <tr>
  30.   30. <th>Schools</th>
  31.   31. <th>Dates</th>
  32.   32. <th>Times</th>
  33.   33. </tr>';
  34.   34.  
  35.   35. $fp = fopen('flat-file-data2.txt','r');
  36.   36. if (!$fp) {echo 'ERROR: Unable to open file.</table></body></html>'; exit;}
  37.   37.  
  38.   38. while (!feof($fp)) {
  39.   39.     $line = fgets($fp,1024); //use 2048 if very long lines
  40.   40.     $row++;
  41.   41.     list ($schools, $dates, $times) = split ('\|', $line);
  42.   42.     if ($sortby == 'schools') $sortkey = strtolower($schools);
  43.   43.     if ($sortby == 'dates') $sortkey = strtolower($dates);
  44.   44.     if ($sortby == 'times') $sortkey = strtolower($times);
  45.   45.     $col[$row] = array($sortkey, $schools, $dates, $times);
  46.   46. }
  47.   47.  
  48.   48. fclose($fp);
  49.   49.  
  50.   50. $arrays = count($col) - 1;
  51.   51.  
  52.   52. $loop = 0;
  53.   53. while ($loop < $arrays) {
  54.   54.     $loop++;
  55.   55.     echo '
  56.   56. <tr>
  57.   57. <td>'.$col[$loop][1].'</td>
  58.   58. <td>'.$col[$loop][2].'</td>
  59.   59. <td>'.$col[$loop][3].'</td>
  60.   60. </tr>';
  61.   61. }
  62.   62.  
  63.   63. echo '
  64.   64. </table>
  65.   65.  
  66.   66. '?>
.txt
Anderson Primary School|Monday 15 Dec 2009|2pm to 5pm
|Monday 15 Dec 2009|2pm to 5pm
|Monday 15 Dec 2009|2pm to 5pm
Ahmad Ibrahim Primary School|Monday 15 Dec 2009|2pm to 5pm
Chongfu Primary School|Monday 15 Dec 2009|2pm to 5pm
MacPherson Primary School|Monday 15 Dec 2009|2pm to 5pm
North View Primary School|Monday 15 Dec 2009|2pm to 5pm
Xishan Primary School|Monday 15 Dec 2009|2pm to 5pm
Aug 27 '09 #1
0 1454

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil K | last post by:
I'm trying to format a table where each row will contain a single line of text followed by a number of optional icon images (sometimes none). However, I'm having great difficulty in getting an even...
12
by: Rick DeBay | last post by:
I'm trying to create a layout table, where the spacing between rows varies. I've tried using setting margin-top and border-top for the rows I wan't spaced down from the one above, and I've also...
19
by: CMAR | last post by:
I have the following markup. The problem is that the browser, e.g., IE6, inserts several lines of blank space between the <div> and the following table. Is there a way to minimize that vertical...
1
by: Jim Moe | last post by:
Hello, I am (slowly) in the process of changing a table-based layout to CSS/div-based. One area that uses tables a lot is the main nav menu. I have discovered that tables have advantage: all...
12
by: Sebastien B. | last post by:
I'm wondering if it's at all possible to have spacing between a table's cells, and only between the cells, not between the outter cells and the table's border. See end of message for an example...
3
by: DigMar | last post by:
Hello, Thi is a newbie question regarding the spacing of words in a header with links. I simply want to space the clickable words on my header bar more horizontally. Here is my code to make more...
10
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way...
1
by: joshvito | last post by:
my site is having spacing issues in IE only. The page looks great in FF and Opera, but in IE7, i get a crazy spacing issue around my navigation links. The page source code is located at......
2
by: Bram2 | last post by:
I'm trying to create a graphical button with custom images and text on it. My approach was to split the generic button image into 3 parts: http://img520.imageshack.us/img520/8263/buttonleftdg8.gif...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.