Forum Moderators: not2easy

Message Too Old, No Replies

don't show text in table

         

Lolalola

11:38 am on Jul 18, 2009 (gmt 0)



The table below is the text and pictures. How don't show only the text?

I try font-size: 0;, but still show text.

rocknbil

2:36 pm on Jul 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



.some-element { display: none; }
.....

<table><tr><td>visible</td><td class="some-element">invisible</td></tr>

One must wonder why you are doing this. If you are using it as a "spacer" of some sort, note that IE won't support anything smaller than 2px, so you can do

.some-element { font-size:2px; }

<table><tr><td class="some-element">&nbsp;</td></tr>

Note that this won't work in a row unless the other TD's are set to the same class. The class "some-element" will indeed be 2px, but it will open up to whatever size is in the adjoining cells.

Also in this scenario, the &nbsp; is needed as IE doesn't like empty cells and may display unexpected results without it.

Lolalola

5:33 pm on Jul 18, 2009 (gmt 0)




.button {
background-image:url(button.jpg); background-repeat:no-repeat;
border:0px solid;
cursor:pointer; cursor:hand;
width:100px;
height:98px;
}

<input type="submit" value="Yes" class="button" name="button" id = "button" />
<input type="submit" value="No" class="button" name="button" id = "button" />

I do not want to show what is in Value. Now on images show No and Yes, I do not want to

rocknbil

5:56 pm on Jul 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah. Well a couple things.

First, you can set the value to blank:
<input type="submit" value="" class="button" name="button" id = "button">

But now both buttons will have the same image and you won't be able to tell which is which. So what you want here is to assign the image to the button by ID:

<input type="submit" value="" name="yes-button" id="YesButton">

<input type="submit" value="" name="no-button" id="NoButton">

#YesButton {
background-image:url(yes-button.jpg); background-repeat:no-repeat;
border:0px solid;
cursor:pointer; cursor:hand;
width:100px;
height:98px;
}

#NoButton {
background-image:url(no-button.jpg); background-repeat:no-repeat;
border:0px solid;
cursor:pointer; cursor:hand;
width:100px;
height:98px;
}

Second, never name or ID any items reserved words. Among those are submit, button, window, search, there are others. If in doubt, name or id your objects something you're sure won't conflict with reserved words, as in the examples above.

The reason being is that if you add Javascript and try to apply actions on an id "submit" or and id "button" you will get an error because it thinks you're referring to the dom object, not an id.