Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I re-read the question and realized I made a big mistake in implementing my answer. I would suggest using a divs like Andy says, but I stand by using javascript and css. I do not see an obvious method to implement dynamic heights to divs or tables without assigning ids and manipulating heights that are generated and returned by the browser. Divs and tables operate in that fashion for some reason.</p> <pre><code>&lt;script type="text/javascript"&gt; /* FUNCTION: resizeTable * DESCRIPTION: Resizes table_id so that it is twice the height of the larger cell. The objective is to have two equally tall rows. * EXAMPLE: &lt;body onload="resizeTable();"&gt; */ function resizeTable() { // get the dom elements of the table and cells var table = document.getElementById("table"); var cell = document.getElementById("cell"); var diva = document.getElementById("div1"); var div4 = document.getElementById("div2"); // determine margin var margin = ( table.offsetHeight - cell.offsetHeight ); // set the div's height to 1 larger than the cells to ensure it is full diva.style.height = ( ( cell.offsetHeight - ( margin / 2 ) ) / 2 ) + "px"; div4.style.height = ( ( cell.offsetHeight - ( margin / 2 ) ) / 2 + 1 ) + "px"; } // add onload event window.onload = function() { resizeTable(); } &lt;/script&gt; &lt;table id="table" border="1" style="border-collapse: collapse;"&gt; &lt;tr&gt; &lt;td id="cell"&gt;1&lt;br /&gt;2a&lt;br /&gt;a&lt;/font&gt;&lt;/td&gt; &lt;td style="padding: 0px;"&gt; &lt;div id="div1" style="width: 5px; background: blue;"&gt; &amp;nbsp; &lt;/div&gt; &lt;div id="div2" style="width: 5px; background: red;"&gt; &amp;nbsp; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
    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.
    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