Home > Web Front-end > Front-end Q&A > How to hide tr in html

How to hide tr in html

藏色散人
Release: 2021-04-12 09:44:06
Original
2969 people have browsed it

htmlHow to hide tr: First create an HTML sample file; then define the rows in the HTML table through the tr tag; finally hide it through "" Can.

How to hide tr in html

## The operating environment of this article: windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Hide and show the tag in Html

Hide and show the TR tag: block (show) and none (hide)

 <tr  style="display:none">
Copy after login
<tr id="sample"
            style="display: <s:if test="sample == 1">block</s:if><s:else>none</s:else>">
            <td>
                sample
            </td>
</tr>
<script type="text/javascript">
function changeTR(selectedValue)
{
    var tr1 = document.getElementById("sample");
    if (selectedValue == 0)
    {
        tr1.style.display = &#39;block&#39;;
    }
    else
    {
        tr1.style.display = &#39;none&#39;;
    }
}
</script>
Copy after login

[Recommended learning:

HTML video tutorial

The above is the detailed content of How to hide tr in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template