Re: [phplib] RESOLVED Table widget hides columns with null first row value From: Chris Stankevitz (chris <email protected>)
Date: 07/16/00

It's an "explicit" space. HTML treats two spaces (" ") as one. For
example, "First Second" will be rendered with one space seperating them,
eventhough they were coded with two spaces. With nbsp, you could say
"First&nbsp;&nbsp;Second", which is rendered with two spaces between them.
Additionally, a "word wrap" will never happen between the words.

Table cells with nothing in them, or table cells which contain only
whitespace, will not appear and look pretty weird if you have borders turned
on. (which is what Jesse thought I was experiencing.) One way to display an
empty table cell is to fill it with a &nbsp;

Jesse suggested I replace my null values with &nbsp; to keep them from being
suppressed. I actually ended up using the empty string "".

Note: If you're using a cheesy email program that shows HTML, you may not
have seen me type the nbsp codes above, which is &_nbsp_; (without the
underscores). You'll have to "view source" or similar to see them.

Chris

At 03:39 PM 7/16/2000 -0400, Eric Ries wrote:
>OK, I admit that this post is completely off-topic, but what is a
>non-breaking space?
>
>Eric
>
>
>At 03:24 PM 7/16/00, Chris Stankevitz wrote:
>
>>Although it does appear that PHPLib's table widget drops the entire column
>>when the first row has a null value, Jesse's IFNULL() idea (quoted below) is
>>a great workaround.
>>
>>Thanks Jesse!
>>
>>Chris
>>
>>At 06:36 AM 7/16/2000 -0400, Jesse Swensen wrote:
>> >on 7/16/00 3:02 AM, Chris Stankevitz at chris <email protected> wrote:
>> >
>> >> <?php
>> >> require("table.inc");
>> >>
>> >> $q = new DB_Lobo;
>> >> $t = new Table;
>> >>
>> >> $q->query("SELECT * FROM lobo;");
>> >> $t->show_result($q);
>> >> ?>
>> >>
>> >> This query (mysql) returns about 100 rows, with columns like first_name,
>> >> homepage_url, primary_email, etc. Only those columns whose values are not
>> >> null in the first row appear! (Verified with different queries.) My mysql
>> >> client shows all the columns, so I assume PHPLib is getting them.
>> >
>> >This may be more of a HTML table thing. If you don't put anything in the
>> >table cell, it is not displayed. No border, etc... So, try this:
>> >
>> >$sql = "
>> > SELECT
>> > IFNULL(col1, '&nbsp;'),
>> > IFNULL(col2, '&nbsp;'),
>> > IFNULL(col3, '&nbsp;')
>> > FROM
>> > lobo
>> >";
>> >
>> >$q->query($sql);
>> >
>> >This will put a non breaking space (nbsp) in the cell if colx is null,
>> >otherwise colx.
>> >
>> >Hope I have understood the problem and this helps...
>> >
>> >--
>> >Jesse Swensen
>> >swensenj <email protected>
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: phplib-unsubscribe <email protected>
>> >For additional commands, e-mail: phplib-help <email protected>
>> >
>> >
>> >
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: phplib-unsubscribe <email protected>
>>For additional commands, e-mail: phplib-help <email protected>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>