Geocrafter Geocrafter - 1 year ago 65
CSS Question

Tables and Borders

I am having a little trouble getting tables and borders to work with css. So what I have been doing is taking the and putting on border-width and border-style on it. Now what happens is the OUTside part of the border is the one being affected by the width and style. All the values and rows inside are not being affected by this. The only thing that will work is the color of the border. And the border had to be specify in HTML as border=1 for some reason.


#usertable {
border-style: dashed;
border-width: 10px;
border-color: red;
padding: 20px;
margin: auto;
margin-top: 20px;
border-collapse: collapse;


echo "<table id=usertable>
<td id=usertable_top>ID</td>
<td id=usertable_top>USERNAME</td>
<td id=usertable_top>PASSWORD</td>
<td id=usertable_top>EMAIL</td>
<td id=usertable_top>ADMIN</td>
<td id=usertable_top>ACTIONS</td>
while($row = $result->fetch_assoc()){
echo "
if ($_SESSION[adminsts] == sadmin) {
echo "
<td>Make Admin</td>
echo "
echo "</table>";

Answer Source

Setting a border on a table will do exactly that.

If you want to set a border on a table cell, then you have to style the table cell.

td, th { 
    border: solid blue 1px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download