Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Three things:</p> <p>1) You'll want to "close" the TR element in the first row.</p> <p>2) You can target the TH elements in the first row as well:</p> <pre><code>$("table td:nth-child(3), table th:nth-child(3)").hide(); </code></pre> <p>3) If you can add the "show date" as a data-date attribute then using some JS you can calculate the difference between today and show date.</p> <pre><code>&lt;table border=1 data-date="2012-12-01"&gt; &lt;tr&gt;&lt;th&gt;Student ID&lt;/th&gt;&lt;th&gt;Grade&lt;/th&gt;&lt;th&gt;Apply Recorrection&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;RS211&lt;/td&gt;&lt;td&gt;C&lt;/td&gt;&lt;td&gt;Click Here&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;RS221&lt;/td&gt;&lt;td&gt;B&lt;/td&gt;&lt;td&gt;Click Here&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;RS251&lt;/td&gt;&lt;td&gt;F&lt;/td&gt;&lt;td&gt;Click Here&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;​ // Today var time_now = $.now(); // The date set in the table's data-date. var date_start = new Date($('table').attr('data-date')); // The table's date turned into microseconds. var time_start = date_start.getTime(); // The difference in days. var date_difference = parseInt((time_now - time_start ) / (86400000)); // If the date difference is greater than X, hide the column. if(date_difference &gt; 12){ $("table td:nth-child(3), table th:nth-child(3)").hide(); } </code></pre> <p>Working sample here:</p> <p><a href="http://jsfiddle.net/hansvedo/TuLMC/" rel="nofollow">http://jsfiddle.net/hansvedo/TuLMC/</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. 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