4

Why <td align="center">5</td> not overriding on table.finTable tbody tr td {text-align:right;}

Jitendra Vyas
  • 142,068
  • 224
  • 557
  • 836

4 Answers4

5

Inline CSS styles override CSS, but inline attributes are not always overrided.

Change your td to style="text-align:center" instead of align="center"

NibblyPig
  • 48,897
  • 65
  • 188
  • 331
1

CSS has precedence over old-style attributes.

At least it should be that way, so that older (now no more existent) browsers that does not understand CSS can render the content with old-style attributes, while newer browsers (all browsers nowadays) will render using CSS.

baol
  • 4,256
  • 30
  • 43
1

CSS rules take higher precedence than element attributes. If you want to override it, use an inline style rule:

<td style="text-align: center;">5</td>
cmptrgeekken
  • 7,832
  • 3
  • 28
  • 33
0

inline style overrides style through css. align="center" being inline has higher precedence and is not overridden.

btw, why would you give an element an inline style when you want it overridden through your style sheet?

ssingh3
  • 125
  • 1
  • 8