Jump to content
Stef's Coding Community
Sign in to follow this  
scampbell70

How Do I Style This?

Recommended Posts

How do I style this table to make it look "prettier" I have tried a little with css and html tags with no luck. 

// display data in table
						        echo "<table border='1' cellpadding='10'>";
						        echo "<tr> <th>ID</th> <th>First Name</th><th>Middle Name</th> <th>Last Name</th><th>Client ID</th><th>Diagnosis</th><th>Gender</th><th>Level of Care</th><th>Counselor</th><th>Active</th><th>Aftercare</th></tr>";
						
						        // loop through results of database query, displaying them in the table 
						        for ($i = $start; $i < $end; $i++)
						        {
						        	// make sure that PHP doesn't try to show results that don't exist
					                if ($i == $total_results) { break; }
					                
						        	// find specific row
						        	$result->data_seek($i);
   	 								$row = $result->fetch_row();
   	 								
   	 								// echo out the contents of each row into a table
					                echo "<tr>";
					                echo '<td>' . $row[0] . '</td>';
					                echo '<td>' . $row[3] . '</td>';
					                echo '<td>' . $row[1] . '</td>';
					                echo '<td>' . $row[2] . '</td>';
					                echo '<td>' . $row[4] . '</td>';
					                echo '<td>' . $row[5] . '</td>';
					                echo '<td>' . $row[7] . '</td>';
					                echo '<td>' . $row[10] . '</td>';
					                echo '<td>' . $row[11] . '</td>';
									echo '<td>' . $row[15] . '</td>';
									echo '<td>' . $row[18] . '</td>';
									echo '<td><a href="records.php?id=' . $row[0] . '">Edit</a></td>';
					                echo '<td><a href="delete.php?id=' . $row[0] . '">Delete</a></td>';
					                echo "</tr>";
						        }

						        // close table>
						        echo "</table>";

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...