Announcement

Collapse
No announcement yet.

displaying a table with php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment

      Working...
      X