[html] Why is visible="false" not working for a plain html table?

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

The answer is


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>

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to html-table

Table column sizing DataTables: Cannot read property 'length' of undefined TypeError: a bytes-like object is required, not 'str' in python and CSV How to get the <td> in HTML tables to fit content, and let a specific <td> fill in the rest How to stick table header(thead) on top while scrolling down the table rows with fixed header(navbar) in bootstrap 3? Sorting table rows according to table header column using javascript or jquery How to make background of table cell transparent How to auto adjust table td width from the content bootstrap responsive table content wrapping How to print table using Javascript?

Examples related to visibility

document.getElementById("remember").visibility = "hidden"; not working on a checkbox Calling the base class constructor from the derived class constructor Equivalent of jQuery .hide() to set visibility: hidden Making a button invisible by clicking another button in HTML Why is visible="false" not working for a plain html table? Make one div visible and another invisible Animate visibility modes, GONE and VISIBLE How to change visibility of layout programmatically How can I make visible an invisible control with jquery? (hide and show not work) How to check visibility of software keyboard in Android?