Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I manage to hide the whole table but im wondering if im able to hide only selected rows with a click of a button .

What I have tried:

<section id="course" class="course-section">
 
       <center><h2 class="course">Course Details</center></h2> 
        <center><table class="regtable"></center>
				<thead>
					<table border='1' align='center' width='100%'>
					<td align=center>ID</td>
<td align=center>Course Name</td>
<td align=center>Price</td>
<td align=center>Description</td></td>
<td align=center>Course Durations</td></td>
<td align=center>Seats Available</td>
<td align=center>Update</td>
<td align=center>Delete</td>
<td align=center></td>
<td align=center></td>
				</thead>
                <tbody>
                <?php foreach($reg_list as $applications) : ?>
                	
					<tr>
					<td align="center">
							<?php echo $applications["ID"] ?>
						
						</td>
						
                	<td align="center">
							<?php echo $applications["Course_Name"] ?>
						</td>
						
						<td align="center">
							<?php echo $applications["Price"]?>
						</td>
						
						<td  align="center">
							<?php echo $applications["Description"]?>
						</td>
						
						<td  align="center">
							<?php echo $applications["Course_Duration"]?>
						</td>
						
						<td  align="center">
							<?php echo $applications["Avail_Seats"]?>
						</td>
						
						<td>
                        	<center><form method="post" action="index.php">
		<input type="hidden" name="ci" value="<?php echo $applications["ID"]; ?>" />
									<input type="hidden" name="action" value="edit" />
									<input type="submit" value="Update" />
								</center></form> 
                        </td>
                        <td>
                        	<center><form method="POST" action="index.php" 
								onSubmit="return ConfirmDelete();">
									<input type="hidden" name="ci" value="<?php echo $applications["ID"]; ?>" />
									<input type="hidden" name="action" value="delete" />
									<input type="submit" value="Delete" />
								</center></form>
                        </td>
						<td>
                        <center>
					<input type="hidden" name="ci" value="<?php echo $applications["ID"]; ?>" />
									<button class="btn1">Hide table</button>
								</center>
						</td>
Posted
Comments
ZurdoDev 20-Aug-18 13:53pm    
Yes, you can hide a tr.
Suriani Kamal 21-Aug-18 12:47pm    
i tired but it hide's the whole table instead
ZurdoDev 21-Aug-18 12:49pm    
Then you did something wrong.
W Balboos, GHB 21-Aug-18 6:28am    
Consider that once you hide a row with a button-click, if you wish to un-hide it how do you do it - aside from a separate button to "unhide all"?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900