Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <main>
  <h1>Multiple Nested Tables with Additional Content</h1>
  <table id="Books">
    <caption>Books I May or May Not Have Read</caption>
    <tr>
      <th id="AuthMoreLbl"><span class="visually-hidden">More on Books By</span></th>
      <th>Author</th>
      <th>Title</th>
      <th>Year</th>
      <th>ISBN-13</th>
      <th>ISBN-10</th>
    </tr>
    <tr>
      <td>
        <button type="button" id="btnAuth01" aria-controls="Auth01More" aria-expanded="false" aria-label="Show more on" aria-labelledby="AuthMoreLbl Auth01" onclick="toggle(this.id,'Auth01More');"><svg xmlns="\http://www.w3.org/2000/svg&quot;" viewBox="0 0 80 80" focusable="false"><path d="M70.3 13.8L40 66.3 9.7 13.8z"></path></svg></button>
      </td>
      <td id="Auth01">Miguel De Cervantes</td>
      <td>The Ingenious Gentleman Don Quixote of La Mancha</td>
      <td>1605</td>
      <td>9783125798502</td>
      <td>3125798507</td>
    </tr>
    <tr style="display:none;" id="Auth01More">
      <td colspan="6">

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>
        

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>

      </td>
    </tr>
    <tr>
      <td>
        <button type="button" id="btnAuth02" aria-controls="Auth02More" aria-expanded="false" aria-label="Show more on" aria-labelledby="AuthMoreLbl Auth02" onclick="toggle(this.id,'Auth02More');"><svg xmlns="\http://www.w3.org/2000/svg&quot;" viewBox="0 0 80 80" focusable="false"><path d="M70.3 13.8L40 66.3 9.7 13.8z"></path></svg></button>
      </td>
      <td id="Auth02">Mary Shelley</td>
      <td>Frankenstein; or, The Modern Prometheus</td>
      <td>1818</td>
      <td>9781530278442</td>
      <td>1530278449</td>
    </tr>
    <tr style="display:none;" id="Auth02More">
      <td colspan="6">

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>
        
      </td>
    </tr>
    <tr>
      <td>
        <button type="button" id="btnAuth03" aria-controls="Auth03More" aria-expanded="false" aria-label="Show more on" aria-labelledby="AuthMoreLbl Auth03" onclick="toggle(this.id,'Auth03More');"><svg xmlns="\http://www.w3.org/2000/svg&quot;" viewBox="0 0 80 80" focusable="false"><path d="M70.3 13.8L40 66.3 9.7 13.8z"></path></svg></button>
      </td>
      <td id="Auth03">Herman Melville</td>
      <td>Moby-Dick; or, The Whale</td>
      <td>1851</td>
      <td>9781530697908</td>
      <td>1530697905</td>
    </tr>
    <tr style="display:none;" id="Auth03More">
      <td colspan="6">

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>
        
      </td>
    </tr>
    <tr>
      <td>
        <button type="button" id="btnAuth04" aria-controls="Auth04More" aria-expanded="false" aria-label="Show more on" aria-labelledby="AuthMoreLbl Auth04" onclick="toggle(this.id,'Auth04More');"><svg xmlns="\http://www.w3.org/2000/svg&quot;" viewBox="0 0 80 80" focusable="false"><path d="M70.3 13.8L40 66.3 9.7 13.8z"></path></svg></button>
      </td>
      <td id="Auth04">Emma Dorothy Eliza Nevitte Southworth</td>
      <td>The Hidden Hand</td>
      <td>1888</td>
      <td>9780813512969</td>
      <td>0813512964</td>
    </tr>
    <tr style="display:none;" id="Auth04More">
      <td colspan="6">

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>
        
      </td>
    </tr>
    <tr>
      <td>
        <button type="button" id="btnAuth05" aria-controls="Auth05More" aria-expanded="false" aria-label="Show more on" aria-labelledby="AuthMoreLbl Auth05" onclick="toggle(this.id,'Auth05More');"><svg xmlns="\http://www.w3.org/2000/svg&quot;" viewBox="0 0 80 80" focusable="false"><path d="M70.3 13.8L40 66.3 9.7 13.8z"></path></svg></button>
      </td>
      <td id="Auth05">F. Scott Fitzgerald</td>
      <td>The Great Gatsby</td>
      <td>1925</td>
      <td>9780743273565</td>
      <td>0743273567</td>
    </tr>
    <tr style="display:none;" id="Auth05More">
      <td colspan="6">

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>
        
      </td>
    </tr>
    <tr>
      <td>
        <button type="button" id="btnAuth06" aria-controls="Auth06More" aria-expanded="false" aria-label="Show more on" aria-labelledby="AuthMoreLbl Auth06" onclick="toggle(this.id,'Auth06More');"><svg xmlns="\http://www.w3.org/2000/svg&quot;" viewBox="0 0 80 80" focusable="false"><path d="M70.3 13.8L40 66.3 9.7 13.8z"></path></svg></button>
      </td>
      <td id="Auth06">George Orwell</td>
      <td>Nineteen Eighty-Four</td>
      <td>1948</td>
      <td>9780451524935</td>
      <td>0451524934</td>
    </tr>
    <tr style="display:none;" id="Auth06More">
      <td colspan="6">

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>

        <div>
          <h2>More Information</h2>

          <table>
            <caption>Pricing</caption>
            <tr>
              <th>Type</th>
              <th>Quantity</th>
              <th>Price</th>
            </tr>
            <tr>
              <td>Hardcover</td>
              <td>10</td>
              <td>$1,000</td>
            </tr>
          </table>

          <div>
            <h2>Even More Information</h2>

            <dl>
              <dt>Description:</dt>
              <dd>Book</dd>
              <dt>Type:</dt>
              <dd>Hardcover</dd>
              <dt>Sale:</dt>
              <dd>No</dd>
            </dl>
          </div>

          <table>
            <caption>Other Details</caption>
            <tr>
              <th>Date</th>
              <th>Quantity</th>
              <th>Pricing</th>
              <th>Adjusted Pricing</th>
              <th>Other Pricing</th>
              <th>More Pricing</th>
              <th>Random Pricing</th>
              <th>Holding Period</th>
            </tr>
            <tr>
              <td>1605</td>
              <td>10</td>
              <td>$1,200</td>
              <td>$1,500</td>
              <td>$1,000</td>
              <td>$1,100</td>
              <td>$1,300</td>
              <td>37 days</td>
            </tr>
            <tr>
              <th scope="row">Totals</th>
              <td>10</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td>$1,200</td>
              <td></td>
            </tr>
          </table>

        </div>

      </td>
    </tr>
  </table>
</main>
            
          
!

CSS

            
              @import url("https://fonts.googleapis.com/css?family=Lato:400,400i,700");

body {
  background-color: #eeeeee;
  font-size: 100%;
  color: #333;
  font-family: Lato, Arial, sans-serif;
  padding: 0;
  margin: 0;
}

main {
  display: block;
  box-sizing: border-box;
  width: auto;
  padding: 1em 1vw;
  margin: 1em 1vw;
  color: #000;
}

table {
  margin: 1em 0;
  border-collapse: collapse;
}

table table {
  margin: 0 0 1em 0;
}

caption {
  text-align: left;
  font-style: italic;
  padding: 0.25em 0.5em 0.5em 0.5em;
}

.visually-hidden,
table table caption {
  position: absolute;
  top: auto;
  overflow: hidden;
  clip: rect(1px 1px 1px 1px); /* IE 6/7 */
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  white-space: nowrap;
}

th,
td {
  padding: 0.25em 0.5em 0.25em 1em;
  vertical-align: text-top;
  text-align: left;
  text-indent: -0.5em;
}

table table th,
table table td {
  border: 0.01em solid #ccc;
}

td[colspan] {
  padding-left: 0.5em;
  text-indent: 0;
}

th {
  vertical-align: bottom;
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-weight: bold;
}

table table th {
  background-color: #757575;
}

tr:nth-child(odd) {
  border-bottom: 0.01em solid #ccc;
}

table table tr {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.01);
}

tr:nth-child(odd) {
  /*   background-color: rgba(255, 255, 255, 0.5); */
}

td:nth-of-type(3),
td td:nth-of-type(1) {
  font-style: italic;
}

td td:nth-of-type(3) {
  font-style: normal;
}

th:nth-of-type(4),
td:nth-of-type(4) {
  text-align: right;
}

td button {
  font-size: 60%;
  color: #000;
  background-color: #00f;
  padding: 0.3em 0.2em 0 0.2em;
  border: 0.2em solid #00f;
  border-radius: 50%;
  line-height: 1;
  text-align: center;
  text-indent: 0;
}

button svg {
  width: 1em;
  height: 1em;
  fill: #fff;
  transition: transform 0.25s ease-in;
  transform-origin: center 45%;
}

td button:hover,
td button:focus {
  background-color: #fff;
  outline: none;
}

td button:hover svg,
td button:focus svg {
  fill: #00f;
}

button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Nested content areas, including tables */

td[colspan] h2 {
  font-size: 120%;
}

td[colspan] h2, td[colspan] dl {
  margin: 0 0 .5rem 0;
}

td[colspan] dt, td[colspan] dd {
  margin: 0;
  float: left;
}

td[colspan] dt {
  font-weight: bold;
  clear: left;
  padding-right: 1em;
}

td[colspan] table:nth-of-type(2) th, td[colspan] table:nth-of-type(2) td {
  text-align: right;
}

td[colspan] table:nth-of-type(2) th:first-child, td[colspan] table:nth-of-type(2) td:first-child {
  text-align: left;
}

td[colspan] table:nth-of-type(2) tr:last-of-type {
  font-weight: bold;
}

/* IE11-friendly grid layout */

td[colspan] > div {
  border-top: .1em solid #ddd;
  padding: 1em 2em;
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: auto auto;
  grid-template-columns: auto auto;
  -ms-grid-rows: auto auto;
}

td[colspan] > div:first-child {
  border-top: none;
}

td[colspan] > div > * {
  align-self: start;
  -ms-grid-row-align: start;
  justify-self: start;
  -ms-grid-column-align: start;
  margin: .5rem 1rem;
}

td[colspan] > div > *:nth-child(1) {
  -ms-grid-row: 1;
  -ms-grid-column: 1;
}

td[colspan] > div > *:nth-child(2) {
  -ms-grid-row: 1;
  -ms-grid-column: 2;
}

td[colspan] > div > *:nth-child(3) {
  -ms-grid-row: 2;
  -ms-grid-column: 1;
}

td[colspan] > div > *:nth-child(4) {
  -ms-grid-row: 2;
  -ms-grid-column: 2;
}
            
          
!

JS

            
              function toggle(btnID, eID) {
  var theRow = document.getElementById(eID);
  var theButton = document.getElementById(btnID);
  if (theRow.style.display == "none") {
    theRow.style.display = "table-row";
    theButton.setAttribute("aria-expanded", "true");
  } else {
    theRow.style.display = "none";
    theButton.setAttribute("aria-expanded", "false");
  }
}

            
          
!
999px

Console