The visible property of html table does not work.
Why do they have that property if its defective? I had to use style="visibility:hidden"
in order to hide a table.
Please explain why. I am very curious
Here's the code I'm using. The intention is to hide the table as a whole but its not hiding the table or the controls inside it
<table visible="false">
<tr>
<td >
<label>Pick the color for action needed and paste it on textbox</label>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Apply color" />
</td>
</tr>
</table>
This question is related to
html
html-table
visibility
For the best practice - use style="display:"
it will work every where..
Use display: none
instead. Besides, this is probably what you need, because this also truncates the page by removing the space the table occupies, whereas visibility: hidden
leaves the white space left by the table.
You probably are looking for style="display:none;"
which will totally hide your element, whereas the visibility hides it but keeps the screen place it would take...
UPDATE: visible
is not a valid property in HTML, that's why it didn't work... See my suggestion above to correctly hide your html element
Who "they"? I don't think there's a visible
attribute in html
.
If you want use it, use runat="server"
for that table. After that use tablename.visible=False
in server side code.
visibility:hidden is the proper syntax, but another way to 'hide' the table is with display:none or dynamically with JQuery:
$('#myTable').hide()
The reason that visible="false" does not work is because HTML is defined as a standard by a consortium group. The standard for the Table element does not have a visibility property defined.
You can see all the valid properties for a table by going to the standards web page for tables.
That page can be a bit hard to read, so here is a link to another page that makes it easier to read.
For a similar post a long time ago there seems to be issues with making table visibility hidden.
You have two options, one is to use the display:none
attribute.
Or two wrap the table in a div and make the div hidden.
<div id="wrapper" style="visibility:hidden">
<table>
<tr>
<td>
Content
</td>
</tr>
</table>
</div>
Source: Stackoverflow.com