Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>add a table row and a table cell around your link, you have an invalid HTML markup</p> <p>what the browser(most) browsers do they will give you this markup:</p> <pre><code>&lt;a class="showrows" href="#"&gt;Add row&lt;/a&gt; &lt;table&gt; &lt;tbody&gt; &lt;tr class="cache"&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="cache"&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>so you need to change your markup a bit:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;a href="#" class="showrows"&gt;Add row&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr class="cache"&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="cache"&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" size="15"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>and use the jQuery code: $(document).ready(function() {</p> <pre><code> $('tr.cache').css("display","none"); $('.showrows').live('click',function(e){ e.preventDefault(); var table = $(this).closest("table"); $('tr:hidden:first', table).show("fast"); }); </code></pre> <p>});</p> <p>demo:</p> <p><a href="http://jsbin.com/owefew/1/edit" rel="nofollow">http://jsbin.com/owefew/1/edit</a></p>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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