empty cells in a table not displaying correctly

J

Jud McCranie

I'm doing cells in a table with
<TD align="right">text</TD>
When the text is blank, the table isn't displaying correctly in IE and
Firefox - the walls of the cell aren't drawn (although they are spaced
correctly). I've tried leaving the "text" blank and putting blank
characters in there, neither work.

How can I get it to draw the walls of the cell if the text is blank?
 
R

rf

Jud McCranie said:
I'm doing cells in a table with
<TD align="right">text</TD>
When the text is blank, the table isn't displaying correctly in IE and
Firefox - the walls of the cell aren't drawn (although they are spaced
correctly).

That is what is supposed to happen.
I've tried leaving the "text" blank and putting blank
characters in there, neither work.

How can I get it to draw the walls of the cell if the text is blank?

&nbsp;
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Jud McCranie
I'm doing cells in a table with
<TD align="right">text</TD>
When the text is blank, the table isn't displaying correctly in IE and
Firefox - the walls of the cell aren't drawn (although they are spaced
correctly). I've tried leaving the "text" blank and putting blank
characters in there, neither work.

How can I get it to draw the walls of the cell if the text is blank?

Use the empty cell property - http://tinyurl.com/8nztn
 
H

Harlan Messinger

Jud said:
That works, thanks. That puts a half space in there, right?
No half-space. It puts in a full non-breaking space, however the browser
happens to interpret that.
 
J

Jonathan N. Little

Jud said:
I couldn't get that to work. I tried:
<TABLE border=1 width="60%" empty-cells: show>
<TABLE border=1 width="60%" empty-cells=show>
but neither worked. What's wrong?

It is a CSS property not an HTML attribute.

either in your stylesheet add

table { empty-cells: show; }

or put inline in the HTML attribute STYLE:

<TABLE border=1 width="60%" style="empty-cells: show;">
 
J

Jud McCranie

<TABLE border=1 width="60%" style="empty-cells: show;">

That works in Firefox but not IE. (However, the &nbsp; works in
both).

I'm not very familiar with HTML - I'm writing a program that generates
some HYML tables as output.
 
J

Jonathan N. Little

Jud said:
That works in Firefox but not IE. (However, the &nbsp; works in
both).

You now know a web designer's pain, it is summed up in two little
letters...IE!
 
E

Ed Mullen

Jud said:
Yes, I would have thought that IE would be standard.

Depends on what you mean by "standard."

Ubiquitous? Ok, IE is that.

Conforming to accepted agree-upon industry standards? No, IE is
decidedly not. IE7 is getting closer, for sure. Still, anything less
is a morass into which no sane Web page creator wants to willingly go.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
I can't see the point in the theatre. All that sex and violence. I get
enough of that at home. Apart from the sex, of course. - Baldrick -
Sense and Senility
 
E

Ed Mullen

Jud said:
I meant "adhering to standards" rather than being widespread (i.e. a
de facto standard).

Then, no, IE is decidedly not standard. It is an amalgam of proprietary
implementations of standards rendering them incompatible with the
standards. And, it implements many things that do not exist in the
standards and, hence, nothing other than IE can deal with without
extreme work-around programming.

Did that help?

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
One of the great tragedies of life is the murder of a beautiful theory
by a gang of brutal facts. - Benjamin Franklin
 
J

Jukka K. Korpela

Scripsit Jud McCranie:
That works, thanks. That puts a half space in there, right?

No, by definition &nbsp; means the NO-BREAK SPACE character, which is
like the SPACE but probihits line breaks before and after (which means
nothing here) and, as a strange effect due to oddities in web browsers,
partly described in HTML specs, acts as nonempty content in a table
cell.

So it's more or less a hack but it works, mostly. It causes trouble if
you want to make the cell very small in either direction, since NO-BREAK
SPACE has some definite width and some height.

It's a good idea to consider whether it would be better to insert some
other content into the cell, such as "N/A" or "0" or "&ndash;" or
whatever constitutes a useful indication or hint. After all, the user
might not immediately realize _why_ the cell is empty and might even
assume that it might be an error.
 
J

Jud McCranie

So it's more or less a hack but it works, mostly.

It worked for me in IE and Firefox.
It's a good idea to consider whether it would be better to insert some
other content into the cell, such as "N/A" or "0" or "&ndash;" or
whatever constitutes a useful indication or hint. After all, the user
might not immediately realize _why_ the cell is empty and might even
assume that it might be an error.

You have a point, but I specifically wanted a blank for "no value" and
the person I'm writing the program for agreed. The table is a list of
players at a tournament with their total points. Then there are four
columns for different tiebreakers. But usually the first tiebreaker
is decisive and printing all of them has confused people in the past.
The program shows only the tiebreakers that are relevant and blanks
for the rest (even though they are calculated).
 
D

DocuMaker

Sometimes I have to put a blank space in an empty cell to indicate
that the cell even exists:

&nbsp;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top