开发者

How to be able to show Table TD's without text in them

开发者 https://www.devze.com 2023-03-23 03:01 出处:网络
My Question: How can I leave a Table its TD without text, without making it disappear. I use this HTML code:

My Question: How can I leave a Table its TD without text, without making it disappear.

I use this HTML code:

<div id="push_down"></div>

    <div id="global_wrapper">
       <table cellpadding="0" cellspacing="0" border="0" id="sep_table">
           <tr>
              <td id="side_1"></td>
              <td id="main"></td>
              <td id="side_2"></td>
           </tr>
      </table>
    </div>开发者_JAVA技巧;

And this CSS code:

html, body {
margin: 0px;
padding: 0px;
}

#push_down {
    padding-top: 53px;
}
#global_wrapper {
}
#sep_table {
    margin: 0px auto;
    width: 100%;
}
#side_1 {
    background:url(../images/navbar-bg-left.jpg) center repeat-x;
    height:78px;
}
#main {
    background:url(../images/navbar.jpg) center no-repeat;
    height:33px;
    width: 989px;
    padding-top:45px;
}
#side_2 {
    background:url(../images/navbar-bg-right.jpg) center repeat-x;
    height:78px;
}
.navbar{
    font-size:14px;
    font-weight:bold;
    color:#FFF;
}
.navbar a:link{
    color:#FFF;
    text-decoration:none;
}
.navbar a:visited{
    color:#FFF;
    text-decoration:none;
}
.navbar a:hover{
    color:#131313;
    text-decoration:none;
}
.navbar a:active{
    color:#FFF;
    text-decoration:none;
}


With css:

table {
empty-cells:show;
}

In html (not really clean):

<table>
<tr>
<td>&nbsp;</td>
</tr>
</table>


You can also put a transparent image (like a .png image) with 1px height and 1px width.

Photoshop uses space.png as a auxiliar image on table containers when save for web and devices, you can copy this idea.

Remember to put at this same image the height and width 100%, to fill all the table cell.


you can add this style:

td{
    width: 20px;
    height: 20px;
    display: block;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消