2

I am trying to right align the content of a table cell, similar to what is explained here:

<td style="text-align:right">

However, it seems React has decided that the style keyword should not be used like that:

Line XX:  Style prop value must be an object   react/style-prop-object

An answer on this site indicated that "styles" should be used instead:

<td styles="text-align:right">

Of course React thinks that is fine but it is not like my web browser knows that when I say styles I in fact mean style. How can I right align the contents in my table?

Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
jonalv
  • 4,856
  • 8
  • 43
  • 61

2 Answers2

3

Correct usage is

<td style={{ textAlign: 'right' }}>

Reference

asiniy
  • 13,006
  • 7
  • 59
  • 135
0

In your table tag,


<table class="text-center"> </table>