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.

1
  • Just a note for next time - providing a JSFiddle even for simple questions is a good idea just cause. Commented Apr 18, 2016 at 19:20

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.