scampbell70 Posted February 20, 2015 Report Share Posted February 20, 2015 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>"; Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 20, 2015 Report Share Posted February 20, 2015 See http://www.w3schools.com/css/css_table.asp http://css-tricks.com/complete-guide-table-element/ Quote Link to comment Share on other sites More sharing options...
larabrian Posted November 7, 2019 Report Share Posted November 7, 2019 Hope this will help you...CSS Table Styling Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.