Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 742
Enggr Avatar asked Dec 01 '11 15:12

Enggr


People also ask

How do you make an element visible in HTML?

visibility = 'hidden'; element. style. visibility = 'visible';

Is visibility hidden accessible?

The main reason the visibility: hidden rule isn't just about visual visibility is because it affects the elements visibility to assistive technology as well. When we apply visibility: hidden to an element, it also removes it from the accessibility tree, which makes it invisible to technologies like screen readers.

How to make a html element invisible?

To both hide an element and remove it from the document layout, set the display property to none instead of using visibility .


1 Answers

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.

like image 121
Chris C Avatar answered Oct 16 '22 20:10

Chris C