Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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>

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;
}
like image 576
Jasp3r_ Avatar asked Jul 26 '11 10:07

Jasp3r_


People also ask

How do I stop text wrapping in HTML table?

If you want to prevent the text from wrapping, you can apply white-space: nowrap; Notice in HTML code example at the top of this article, there are actually two line breaks, one before the line of text and one after, which allow the text to be on its own line (in the code).

How do you stop a cell from wrapping in a table?

Syntax: white-space: normal|nowrap|pre|pre-wrap|pre-line; Example 1: This example uses white-space property to prevent cell wrapping using CSS.

How do you hide the overflow of a table body?

To use the CSS overflow property with its "hidden" value on the HTML <td> element, you need to set the table-layout property with the "fixed" value and an appropriate width on the <table> element. Then, you need to add the overflow property set to "hidden" and white-space property set to "nowrap" on the table cell.


1 Answers

With css:

table {
empty-cells:show;
}

In html (not really clean):

<table>
<tr>
<td>&nbsp;</td>
</tr>
</table>
like image 83
easwee Avatar answered Oct 18 '22 08:10

easwee