Solved

css alternative to nbsp?

Posted on 2006-07-10
5
4,490 Views
Last Modified: 2008-01-09
Hi all, does anyone know any alternatives to using   to avoid the 'dissapearing border' problem when TD cells have no value. To clarify, i have an html table where data is populated from a database. When the value if 'blank' the border dissapears....the only way i know of getting round this is to use the   in place of the value. It would be nicer though if there was a css property that i could apply to the cell to prevent the border from dissapearing.

thanks in advance.

Dave
0
Comment
Question by:javabeat
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 17072642
Yes, there is something:

emtpy-cells: show

http://www.blooberry.com/indexdot/css/properties/table/emptycell.htm

you can specify whichever behavior you want, you need to use the seperated border model:
http://www.blooberry.com/indexdot/css/properties/table/bcollapse.htm
0
 

Author Comment

by:javabeat
ID: 17073411
Hi brunobear, didn't seem to do the trick for me? if the cell has no contents the border remains invisible...i'm using a fairly recent version of IE but maybe i'm missing something...
0
 
LVL 13

Expert Comment

by:PraxisWeb
ID: 17074258
IE does not support that particular CSS attribute (yet)
0
 
LVL 18

Accepted Solution

by:
bruno earned 200 total points
ID: 17116341
sorry i didn't test first....how about this?



      <style type="text/css" media="screen" title="style">
            table {
                  border-collapse: collapse;
            }
            td {
                  border: 1px solid gray;
                  height: 30px;
                  width: 30px;
            }
      </style>      



<table>
<tr>
      <td>1</td>
      <td></td>
      <td>3</td>
</tr>
<tr>
      <td></td>
      <td>5</td>
      <td></td>
</tr>
<tr>
      <td></td>
      <td></td>
      <td></td>
</tr>
<tr>
      <td></td>
      <td></td>
      <td></td>
</tr>
</table>
0
 

Author Comment

by:javabeat
ID: 17118553
much appreciated!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now