Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make html look disabled?
    primarykey
    data
    text
    <p>I read in some forums that to make an html table look disabled is to add a layer of div. My problem is I don't know how to do it.</p> <p>I have 3 questions:</p> <p>1.) How will I set the div height that it will automatically adjust to the table height whenever the table increases its height when a new row is added.</p> <p>2.) How will I make the div cover the table. I don't know how to layer html elements.</p> <p>3.) How am I going to code the javascript that will make my table look disabled when I click 'Disable' button and enable it again when I click 'Enable' button. </p> <p><b><code>tabledisabletest.html</code></b></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; &lt;/script&gt; &lt;style type="text/css"&gt; table#tblTest { width: 100%; margin-top: 10px; font-family: verdana,arial,sans-serif; font-size:12px; color:#333333; border-width: 1px; border-color: #666666; border-collapse: collapse; } table#tblTest tr.highlight td { background-color: #8888ff; } table#tblTest tr.normal { background-color: #ffffff; } table#tblTest th { white-space: nowrap; border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede; } table#tblTest td { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff; } #disabler { width: 100%; height: 200px; background-color: #bbb; opacity:0.6; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="disabler"&gt;&lt;/div&gt; &lt;table id="tblTest"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Address&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Tom&lt;/td&gt; &lt;td&gt;UK &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Henrik&lt;/td&gt; &lt;td&gt;Denmark&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Lionel&lt;/td&gt; &lt;td&gt;Italy&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Ricardo&lt;/td&gt; &lt;td&gt;Brazil&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Cristiano&lt;/td&gt; &lt;td&gt;Portugal&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;input type="button" onclick="disable = true;" value="Disable" /&gt; &lt;input type="button" onclick="disable = false;" value="Enable" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I have the div <code>disabler</code> to do the disabling but I can't make it cover the table.</p> <p>Please help me with this. Im so new to this thing. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload