JSFiddle - React, Tailwind, and code Playground

by prozoroff

HTML

<table id="t1">
<thead>
  <tr>
  <th>First</th>
  <th>Second</th>
  </tr>
</thead>
<tbody>
<tr><td>1</td><td>2</td></tr>
<tr><td>3</td><td>4</td></tr>
</tbody>
</table>

<table id="t2">
<thead>
  <tr>
  <th>First</th>
  <th>Second</th>
  <th>Third</th>
  </tr>
</thead>
<tbody>
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
</tbody>
</table>

JavaScript

var t1 = document.getElementById('t1');
var t2 = document.getElementById('t2');


alert('t1 scroll height: ' + t1.scrollHeight)
alert('t2 scroll height: ' + t2.scrollHeight)