Empty cell problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How do you handle empty cells in tables with borders?

I tried using empty-cells:show, but it doesn't work in IE.  It does work in
all the other browsers, however.

I know I could use &nbsp in the empty cells, but that is difficult to do
when doing a databind in asp.



Re: Empty cell problem

tshad wrote:

Quoted text here. Click to load it

Don't know much about ASP databinds, but can't you write a little function
that formats the data before spitting it out?


    function myFormatString ($string)
        if ($string=='')
            return " "
            $string = str_replace('&','&'$string);
            $string = str_replace('<','&lt;'$string);
            $string = str_replace('>','&gt;'$string);
            return $string

And then use it like so:

    print "<td>" . myFormatString($value) . "</td>\n";


(Obviously substituting VBScript/JScript/PerlScript for the PHP syntax

Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact

Re: Empty cell problem

Quoted text here. Click to load it

I avoid them by inserting suitable dummy or non-dummy content; see

Quoted text here. Click to load it

I bet you haven't tested all the other browsers; I bet you could not
even name them. But I'll buy the claim that it works on other browsers
that have a market share over 1% these days. The failure on IE 6
is a sufficient reason to think about something else, though.

Quoted text here. Click to load it

As Toby commented, it can be done.

But primarily, I think you should consider what would be the most
suitable non-blank content for cells that lack "real" content.
Sometimes it's a dash; sometimes "0"; sometimes "N/A"; or something

Yucca, http://www.cs.tut.fi/~jkorpela /
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Site Timeline