Page 1 of 1

Datagrid

Posted: Tue Mar 24, 2009 12:54 pm
by lubber123
I have created a form where users can enter/update info into a DB. They select from a grid data to update or delete. I have defined the width for each column in the grid and still when some text is too long it makes the grid lines mis-align. How do I get them to keep their integrity?

Also, sometimes when i receive data (multiple words) out of the database and display it in a text box, the text box only displays the first word and stops when it finds whitespace. I check the Db and all the words are there but it only displays one word. What am I doing wrong?

Re: Datagrid

Posted: Tue Mar 24, 2009 1:07 pm
by Christopher
Are you using <div> or <table>. It sounds like you should be using <table> which is for tabular data grids.

Re: Datagrid

Posted: Wed Mar 25, 2009 10:20 am
by lubber123
table

Code: Select all

echo " <br /><table width=100%  border=0 cellspacing=2 cellpadding=0 class='text'>";
                          echo " <tr></tr>";
                          echo " <tr></tr>";
                          echo " <tr align='center' valign='middle' class = 'gridbackgroundblue'>";
                          echo "  <td width=15%><strong>Created by</strong></td>";
                           echo "  <td width=35%><strong>Email <br />(Click link to email)</strong></td>";
                           echo "  <td width=15%><strong>Date</strong></td>";                        
                          echo "  <td width=15%><strong>Title</strong></td>";
                          echo "  <td width=10%><strong>#copies</strong></td>";
                          echo "  <td width=10%><strong>Status</strong></td>";
                          echo " </tr>";
                          echo " </table>";
                        $rowbackground = 0;
                        
                while($row = mysql_fetch_array($result)){
                    if($rowbackground == 0){
                        $back = "gridbackgroundgrey";
                        $rowbackground++;
                    }else{
                        $back = "gridbackgroundwhite";
                        $rowbackground --;
                    }
 
                      echo " <table width=100%  border=0 cellspacing=2 cellpadding=0>";
                      $subjectid = $_SESSION['subjectid'];
                              echo " <tr align='left' valign='middle' class = " . $back . ">";
                              echo "  <td width=15%><a href='cd_duplication_request.php?id=" . $row['id'] . "&function=" . $function . "' class = 'gridtext'>" . stripslashes(htmlentities($row['first_name'])) . " " . htmlentities($row['last_name']) . "</a></td>";
                              echo "  <td width=35%><a href=mailto:'". stripslashes(htmlentities($row['email'])) . "'>" . stripslashes(htmlentities($row['email'])) . "</a></td>";
                              echo "  <td width=15%><a href='cd_duplication_request.php?id=" . $row['id'] . "&function=" . $function . "' class = 'gridtext'>" . stripslashes(htmlentities($row['request_date'])) . "</a></td>";
                              echo "  <td width=15%><a href='cd_duplication_request.php?id=" . $row['id'] . "&function=" . $function . "' class = 'gridtext'>" . stripslashes(htmlentities($row['cd_title'])) . "</a></td>";
                              echo "  <td width=10%><a href='cd_duplication_request.php?id=" . $row['id'] . "&function=" . $function . "' class = 'gridtext'>" . stripslashes(htmlentities($row['number'])) . "</a></td>";
                              echo "  <td width=10%><a href='cd_duplication_request.php?id=" . $row['id'] . "&function=" . $function . "' class = 'gridtext'>" . stripslashes(htmlentities($row['status'])) . "</a></td>";
                              echo " </tr>";
                              echo " </table>";