+ Reply to Thread
Results 1 to 3 of 3

Thread: displaying a table with php
      
   

  1. #1
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default displaying a table with php

    hello
    i have this code :
    Code:
    // keeps getting the next row until there are no more to get
    echo "<table border='1'>";
    echo "<tr> <th>Date</th> <th>Title</th><th>Area</th> </tr>";
    $num = 0;
    while($info = mysql_fetch_array( $data )) {
    // Print out the contents of each row into a table
    $key = 'unique_key_'.$num;
    echo "<tr><td>"; 
    echo '&nbsp'.$info['Submission_Date'];
    echo "</td><td>";
    echo '<a href="#" onclick="return doToggle(\''.$key.'\');">'.$info['posting_title'].'</a><br />';
    echo '<div id="'.$key.'" style="display:none;">';
     
    echo $info['posting_discription'];
     
     
    echo "</div>";
    echo "</td><td>";
    echo '&nbsp'."(".$info['living_area'].")";
    echo "</td></tr>"; 
    $num++;
    } 
    echo "</table>";
    and basicaly it works fine but i have one problem , when some one write a posting he doesnt have any limit of words and thats how i want it and in the database it stores however it is but when im asking for that information to appear buy a collapsin DIV with a link the posting apperas all over the screen instead of breaking with the table borders
    begining:
    date title
    **** *******
    after clicking the link :
    date
    ****
    title |table border
    ********
    **************************************
    instead of like i want:
    date
    *****
    title |table border
    *********
    **************
    ************
    **********
    ( the colums r under each other here cus i didnt have a way to show it differntly , buy they side by side "date title ")
    thanks for any help

  2. #2
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default Re: displaying a table with php

    basicaly i wanted to know if and how can i breake the LONG row of posting to smaller rows or to make the table FIXED the it will breake the posting cus the width is fixed

    10x

  3. #3
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: displaying a table with php

    Just change

    Code:
    <div id="'.$key.'" style="display:none;">
    to something like

    Code:
    <div id="'.$key.'" style="display:none; width: 300px">
    If you set a width it will wrap the text

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49