Clear blank space at the end of a table ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maceved23
Forum Newbie
Posts: 17
Joined: Sun Jul 13, 2003 11:56 pm

Clear blank space at the end of a table ???

Post by maceved23 »

Hi I would like to ask if there is a methode to clear the blank space on a php page.

The exact problem is that I create a querry to a DB and when the table has some fields empty I get a blank space.

I need to fix that so the blank space dispeare.

PEASE HELP

MARIO
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

I'm confused by your question. What does your table layout look like? What does your query look like?
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

In the case of a blank field, make the content of the cell to be &nbsp ; instead of the field content. I mean something like this:

Code: Select all

<table>
<tr>
   <td><?php echo (empty($row['id']) ? '&nbsp ;' : $row['id']); ?></td>
</tr>
</table>
-- Scorphus
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

It should be &nbsp; without the space before the semi-colon ';' but &nbsp; gets parsed by the forum engine when posting a message with a BBCode. Very odd. BTW, & didn't get parsed!

-- Scorphus
maceved23
Forum Newbie
Posts: 17
Joined: Sun Jul 13, 2003 11:56 pm

Post by maceved23 »

HI

I think my question is not clear look here is a link maybe this way it become more clear.

the last info I get from my DB is the one I show, but I get a lot of blank space in the end of the table, thi 'cause I only show the fields that has info in the DB, if all the fields had info the tahle will be full but in this case no.

The link is: http://www.jahvmcgregor.com.co/temporal/1.htm

HELP IT'S BECOMING A PROBLEM FOR ME
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

Showing some code almost always helps too.

It looks like you are outputting empty rows. You may need to use a function like mysql_num_rows to figure out how many rows you have. You might also use LIMIT in your SQL to limit how many rows are returned. You'll need to use LIMIT if your going to do any paging of the data.
Post Reply