2

I'm trying to style my table very simply:

table{
     border: 1px;
     cellpadding: 3px;
     cellspacing: 0px;
}

td{
     text-align:center;
}

The td styling works (so I know it's finding the CSS file correctly), but the table styling doesn't. I can add the table styling directly to the table tag and that works (so the arguments are correct), so I'm not sure what I'm doing wrong.

DFL
  • 173
  • 1
  • 14

1 Answers1

1

table{
     border: 1px solid #ccc;
     cellpadding: 3px;
     cellspacing: 0px;
      width: 500px;
}

td{
     text-align:center;
}
<!DOCTYPE html>
<html>
<head>
 <title></title>
</head>
<body>
<table>
 <tr>
  <td>
   captain
  </td>
 </tr>
</table>
</body>
</html>

It is working, just assign some width so that the text should come in centre.

Riot Zeast Captain
  • 958
  • 5
  • 13
  • 35