Note that there are some explanatory texts on larger screens.

plurals
  1. POcolumn height of two tables
    primarykey
    data
    text
    <p>I have two tables side by side, how do i make the the column heights for both tables are identical using jQuery? They both have the same amount of rows. and the content of table is created dynamically. So the height may vary.</p> <pre><code>&lt;div class="row"&gt; &lt;div class="span2 pull-left"&gt; &lt;table class="table table-bordered pull-left" id="compare-tbl-1" border="1"&gt; &lt;thead&gt; &lt;th&gt;Column 1&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Row1&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row2&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row3&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row4&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row5&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class="span10 pull-right"&gt; &lt;table class="table table-bordered" id="compare-tbl-2"&gt; &lt;thead&gt; &lt;th&gt;Column 1&lt;/th&gt; &lt;th&gt;Column 2&lt;/th&gt; &lt;th&gt;Column 3&lt;/th&gt; &lt;th&gt;Column 4&lt;/th&gt; &lt;th&gt;Column 5&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Row1 Column1&lt;/td&gt; &lt;td&gt;Row1 Column2&lt;/td&gt; &lt;td&gt;Row1 Column3&lt;/td&gt; &lt;td&gt;Row1 Column4&lt;/td&gt; &lt;td&gt;Row1 Column5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row2 Column1&lt;/td&gt; &lt;td&gt;Row2 Column2&lt;/td&gt; &lt;td&gt;Row2 Column3&lt;/td&gt; &lt;td&gt;Row2 Column4&lt;/td&gt; &lt;td&gt;Row2 Column5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row3 Column1&lt;/td&gt; &lt;td&gt;Row3 Column2&lt;/td&gt; &lt;td&gt;Row3 Column3&lt;/td&gt; &lt;td&gt;Row3 Column4&lt;/td&gt; &lt;td&gt;Row3 Column5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row4 Column1&lt;/td&gt; &lt;td&gt;Row4 Column2&lt;/td&gt; &lt;td&gt;Row4 Column3&lt;/td&gt; &lt;td&gt;Row4 Column4&lt;/td&gt; &lt;td&gt;Row4 Column5&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row5 Column1&lt;/td&gt; &lt;td&gt;Row5 Column2&lt;/td&gt; &lt;td&gt;Row5 Column3&lt;/td&gt; &lt;td&gt;Row5 Column4&lt;/td&gt; &lt;td&gt;Row5 Column5&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Basically, Row1 in table1 must be the same as Row1 in table2, row2 = row2, row3 = row3 and so on. table1 follows table2's height</p> <p>My code is here <a href="http://jsfiddle.net/Q4tLX/8/" rel="nofollow">http://jsfiddle.net/Q4tLX/8/</a> </p>
    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.
 

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