I'm printing the results of a DB query that gets a 300 row staff directory.
All 300 rows appear on one page. The top of the HTML table has basic headers
like "First Name, Last Name, Email" etc, then all 300 rows print underneath
the headers. What I would like to do is have those headers repeat every 33
rows, so that as the user scrolls down that can still see the table headers
every so often. I feel like this should be easy, but it's giving me a hard
time. Any suggestions? My code is below.

Thanks, Sam

$tableHeaders = "

    <td  class='printRev'><b>Staff Name</b></td>
    <td class='printRev'><b>Office Location</b></td>
    <td class='printRev'><b>Primary Telephone</b></td>
    <td class='printRev'><b>Ext</b></td>
    <td class='printRev'><b>Email</b></td>
    <td class='printRev'><b>Direct Telephone</b></td>
    <td class='printRev'><b>Cell/Pager</b></td>

echo "<table width='850' border='1' cellpadding='1' cellspacing='0'
echo "$tableHeaders";

while ($row = mysql_fetch_array($result)) {

  $count = count($result);
  $staff_id = $row['staff_id'];
        $staff_fname = $row['staff_fname'];
        $office_name = $row['office_name'];
        $staff_lname = $row['staff_lname'];
        $staff_phone = $row['staff_phone'];
        $staff_phone2 = $row['staff_phone2'];
        $staff_email = $row['staff_email'];
        $office_phone = $row['office_phone'];
  $ext = $row['ext'];
//strip slashes from textfields

$staff_fname = stripslashes($staff_fname);
$staff_lname = stripslashes($staff_lname);
$office_name = stripslashes($office_name);
$tableContent = "

    <td class='print' bgcolor='#ffffff'>$staff_lname, $staff_fname</td>
    <td class='print' bgcolor='#ffffff'>$office_name&nbsp;</td>
    <td class='print' bgcolor='#ffffff'>$office_phone&nbsp;</td>
    <td class='print' bgcolor='#ffffff'>$ext&nbsp;</td>
    <td class='print' bgcolor='#ffffff'>$staff_email&nbsp;</td>
    <td class='print' bgcolor='#ffffff'>$staff_phone&nbsp;</td>
    <td class='print' bgcolor='#ffffff'>$staff_phone2&nbsp;</td>

 echo "$tableContent";
  } //close while loop

echo "

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to