I found the other answers helpful but I didn't see a good explanation with an example so here is how I did it with a simple HTML file...
For the rows you want to show/hide, wrap them in a tbody element and give it a unique id:
<tbody id="collapsible-rows" style="display: none;">
<tr>
<td>Col1 data 3</td>
<td>Col2 data 3</td>
<td>Col3 data 3</td>
</tr>
<tr>
<td>Col1 data 4</td>
<td>Col2 data 4</td>
<td>Col3 data 4</td>
</tr>
</tbody>
Here I have set display: none so the rows will be hidden initially/by default.
On the header for the collapsible section add an onclick method:
<tr onclick="CollapseRows()">
<th colspan="3" id="click-to-expand">Not So Important Information (click to expand)</th>
</tr>
I have used "(click to expand)" and "(click to collapse)" as the changing text but you could just as easily use "+" and "-".
Below is the method, which does two things. 1) Gets a reference to the tbody element and collapses or expands the rows by setting display to none or to table-row-group. 2) Gets a reference to the section header and changes the displayed text when it's clicked.
function CollapseRows(){
let collapsibleRows = document.getElementById("collapsible-rows");
let clickToExpand = document.getElementById("click-to-expand");
if (collapsibleRows.style.display === "none") {
collapsibleRows.style.display = "table-row-group";
clickToExpand.innerHTML = "Not So Important Information (click to collapse)";
} else {
collapsibleRows.style.display = "none";
clickToExpand.innerHTML = "Not So Important Information (click to expand)";
}
}

Here is the full example:
<html>
<head>
<style>
table {
width: 400px;
}
table, td {
border: 1px solid #333; /*border size & color*/
border-collapse: collapse; /*No margin around the cells*/
}
th /*table header*/
{
background-color: #e8f6fc; /*Header row color*/
color: #000000; /*header row text color*/
border: 1px solid #333;
}
</style>
<script>
function CollapseRows(){
let collapsibleRows = document.getElementById("collapsible-rows");
let clickToExpand = document.getElementById("click-to-expand");
if (collapsibleRows.style.display === "none") {
collapsibleRows.style.display = "table-row-group";
clickToExpand.innerHTML = "Not So Important Information (click to collapse)";
} else {
collapsibleRows.style.display = "none";
clickToExpand.innerHTML = "Not So Important Information (click to expand)";
}
}
</script>
</head>
<table>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<th colspan="3">Important Information</th>
</tr>
<tr>
<td>Col1 data 1</td>
<td>Col2 data 1</td>
<td>Col3 data 1</td>
</tr>
<tr>
<td>Col1 data 2</td>
<td>Col2 data 2</td>
<td>Col3 data 2</td>
</tr>
<tr onclick="CollapseRows()">
<th colspan="3" id="click-to-expand">Not So Important Information (click to expand)</th>
</tr>
<tbody id="collapsible-rows" style="display: none;">
<tr>
<td>Col1 data 3</td>
<td>Col2 data 3</td>
<td>Col3 data 3</td>
</tr>
<tr>
<td>Col1 data 4</td>
<td>Col2 data 4</td>
<td>Col3 data 4</td>
</tr>
</tbody>
</table>
</html>