Jump to content

jefepwnzer

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jefepwnzer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Drummin: That worked, the div now wraps around the table and I can position it as needed, thank you very much! PaulRyan: I added in your code, it didn't seem to have any affect on the table after I added in Drummin's code, not sure if any affect should be seen. I still have one problem remaining: I can't get anything to align below the table. "This text should be at the bottom" has been placed at the end of the code and yet it still appears at the top (see image below). Is this proper and I'm just not understanding something or should it be appearing at the bottom? Right now the code is echo "<br /> This text should be at the bottom"; but I've also tried simply putting it after the PHP code, in HTML, but I get the same result. Like I said before, I'm trying to add some space in between the end of the table and the page, and eventually there will be a footer that needs to sit below the table. <html> <head> </head> <body> <?php // PHP code for the table ?> This text should be at the bottom </body> </html> Thanks again for everyone's help and quick replies, I really appreciate it.
  2. Thanks for the help PaulRyan, however that didn't correct the issue. The div box remains at the top, and not wrapped around the table.
  3. Your help is much appreciated, Xtop, however, I copy and pasted your code and am getting the same problem that I experienced. The div does not wrap around the table itself. This problem occurs in IE, Firefox and Chrome.
  4. Hello all, I've run into a problem with what seems to be a basic script. I want to display two different tables of data, side by side. Each table is built with a while loop, pulling data from an MySQL query. When I try to wrap the first table in a div the result is a div that appears empty when there is really a table with 60 rows of data I expect it to wrap around. I can't get this to work, I've tried to insert the div tag in many places to no avail. Also, I wanted to add some blank space at the bottom of the page so that there was room between the end of the table and the actual bottom of the page. I tried adding some <br />'s at the end of the code but that didn't work. I guess I'm confused because the code is acting as if the 60 rows of table data isn't there. When I tried to add my page layout around the script (as includes at the top and bottom of the script) the layout acts as if the table isn't there, either. That is to say that my "header" and "footer" appear bunched up at the top of the page as if there wasn't content on the screen. Hopefully someone can help! Thanks. <?php echo "<br /> <a href='index.php'> Back Home </a> <br /> <br />"; // -------------------------- Connect to DB include ('connect_script.php'); // ------------------------------ Color variable for alternating table colors $color = 1; // ------------------------- Query Parameters $select = "SELECT (number) AS id, (first_name) AS fn, (last_name) AS ln, (position) AS position FROM table WHERE position = 'X' "; $get = @mysqli_query ($dbc, $select); // ------------------------- Run Query if ($get) { // ------------------------Start table echo " <div style='border-style: solid;'> <table align='left' border='1'> <tr> <td>People</td> </tr> <tr> <td>ID</td><td>First Name</td><td>Last Name</td><td>Position</td> </tr>"; // ------------------------ Retrieve People while ($row = mysqli_fetch_array($get, MYSQLI_ASSOC)) if ($color==1) {echo ' <tr bgcolor= #47EA7D> <td>' . $row['id'] . '</td><td>' . $row['fn'] . '</td><td>' . $row['ln'] . '</td><td>' . $row['position'] . '</td> </tr>'; $color = '2';} else {echo ' <tr bgcolor= #A4C8B0> <td>' . $row['id'] . '</td><td>' . $row['fn'] . '</td><td>' . $row['ln'] . '</td><td>' . $row['position'] . '</td> </tr> '; $color= '1';} // ----------------------- Close table echo "</div> </table>"; mysqli_free_result ($get); } // -------------------- IF ERROR WITH QUERY else {echo "Didn't connect";} // ---------------------- Spaces --> This is the code that doesn't appear to affect the space at the bottom of the table echo "<br /> <br /> <br />"; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.