Jump to content

Recommended Posts

Here is some PHP code that generates multiple tables by pulling info from a MySQL table that has around 150 "players" in it.  In other words, this code generates around 150 individual html tables...

 

 

<?php

$sql = "SELECT firstname, lastname, playerid, team, teamid
FROM quarterbacks
ORDER BY teamid";
$QBs_set = mysql_query($sql, $connection);
if (!$QBs_set) {
die("Database query failed: " . mysql_error());
} else {

			mysql_data_seek($QBs_set, 0); // reset pointer to 0. 

         		while ($QBsArray = mysql_fetch_array($QBs_set)) {
             
                echo "<table id='player'><tr><td rowspan='2'><input type='checkbox' name='qb[]' value='{$QBsArray['playerid']}'></td><td class='image' rowspan='2'><img src='images/quarterbacks/qb" . $QBsArray['playerid'] . ".jpg' /></td><td id='player' >" . $QBsArray['firstname'] . "<br>" . $QBsArray['lastname'] . "</td></tr><tr><td><img id='logo' src='images/teamlogos/team" . $QBsArray['teamid'] . ".gif' width=30 height=30/></td></tr></table>";
           		 }
			 echo "<input type='submit' name='submit' value='Submit'>";
}
?>

 

The CSS code for all of those Tables that get created with the id of "player" is...

 

table#player {

 

  position: relative;

  top: 20px;

  left: 50px;

  height: 60px;

  width: 130px;

  display: inline;

  border: 1px solid black;

  }

 

Now, WITHOUT "display: inline", they get stacked one on top of the other down the left hand side of the page. 

But WITH "display: inline", they get displayed across the page (about seven across) and then jump to the next line and puts seven more across and so on and so on.  This is the way I NEED them to display.

 

But WITH "display: inline," Firefox doesn't respect the "height" and "width" part of the CSS and that is my problem, because I think it only respects it when display is set to "block."

 

Any ideas? I put this question in the CSS forum for any ideas, but I'm also putting it here in case I am missing something simple that would let me make the tables generated by the PHP code display ACROSS the screen (left to right) without needing to declare "display: inline" in the CSS.

 

Is there anyway to do this that anyone can think of?

 

Link to comment
https://forums.phpfreaks.com/topic/141354-heightweight-and-display-inline/
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.