I am trying to center a table on a HTML file. When I do it within the tag:
e.g. table align="center",
it seems to work. However, when I apply this in the external CSS file, it doesn't have any effect.
e.g. (in the external CSS) table {align:center}
.
The same happens when I try doing this internally within the <head><style></style></head>
tags.
What is the reason for why it's not working? (I'm mainly curious about why the align="center" works but the align:center (in css) doesn't). And if this way is incorrect then what are some alternatives?
I am using this table as a menu bar which should appear on every webpage so I do not want to continuously repeat the first-mentioned method. I'm quite new to HTML and CSS so any help is appreciated. Thanks.