Solved

css alternative to nbsp?

Posted on 2006-07-10
5
4,487 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Read about why website design really matters in today's demanding market.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

743 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

13 Experts available now in Live!

Get 1:1 Help Now