title: Show more/less button (expand text) in table cell
body: <p>I have a html table that is populated using PHP:</p>
  
  <pre><code>&lt;table class="flat-table flat-table-1" width="100%"&gt;
  
  &lt;tr style="background-color:#FFF;"&gt;
      &lt;td class="table-head"&gt;Name&lt;/td&gt;
      &lt;td class="table-head"&gt;Review&lt;/td&gt;
      &lt;td class="table-head"&gt;Rating&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  //run a query to find all the fields in the review table that belong to the specific hall, using the id in the url ($current_id)
  if ($r = $db-&gt;prepare("SELECT * FROM reviews WHERE hall_id = :current_id")) {
      //bind the parameters used in the above query using the 'current_id' variable
      $r-&gt;bindParam(':current_id', $current_id);
      //Execute the prepared query
      $r-&gt;execute(); 
  
      //search review table for all fields and save them in $review
      $reviewtemp = $r-&gt;fetchAll();
      foreach( $reviewtemp as $review) {
  
      //loop and output the reviews
  ?&gt;
  
  &lt;tr&gt;
  &lt;td&gt;&lt;? echo $review['name'];?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;? echo $review['review']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;? echo $review['overall']; }}?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The - <code>&lt;td&gt;&lt;? echo $review['review']; ?&gt;&lt;/td&gt;</code>' - contains longs pieces of text that need to be shorted using a show more/less button, if the piece of text is over 400 characters.</p>
  
  <p>I have tried using pieces of code I have found on the internet but have had no luck. I am hoping that maybe somebody on here can point me in the right direction? I am happy to use any solution I can.</p>
  
  <p>The following piece of code is the kind of thing I need to use, however I am unsure how to implement it into my code: <a href="http://jsfiddle.net/Wpn94/326/" rel="nofollow noreferrer">http://jsfiddle.net/Wpn94/326/</a></p>
  
  <p><strong>(--I have previously asked a similar question before but had no responses. I have now changed the question and have posted it again--)</strong></p>