javascript - Hide/show more text button within table cell -


i have html table populated using php script. script loops through table in database , outputs values of 2 fields 2 different cells in table, on , over... 2 different values review of university hall, , name of person left review.

some reviews can long , therefore need shortened, using more/less button. unsure how create button , appear in every cell of table (so each review can expanded).

i'm aware i've not explained well, if knows of way achieve grateful!

edit:

sorry should have put code in here.

below html code table , php code:

<tr> <td><table class="flat-table flat-table-1" width="100%"> <tr> </tr>  <tr style="background-color:#fff;"> <td class="table-head">name</td> <td class="table-head">rating</td> </tr>  <?php //run query find fields in hall table belong specific     university, using id in url ($current_id) if ($r = $db->prepare("select * reviews hall_id = :current_id")) {    $r->bindparam(':current_id', $current_id);   $r->execute(); // execute prepared query.  //search table fields , save them in $hall $reviewtemp = $r->fetchall(); foreach( $reviewtemp $review) {  //loop , output hall names below ?> <tr> <td><? echo $review['name'];?></td> <td><? echo $review['review']; }}?></td> </tr> </table> </td> </tr> </table> 

the more/less button needs appear @ bottom of 'td' -

<td><? echo $review['review']; }}?></td> 

why not output javascript link hide/show additional content?

show more javascript


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -