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,753
  • 72
  • 57
  • 129
jonalv
  • 5,706
  • 9
  • 45
  • 64

2 Answers2

4

Correct usage is

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

Reference

Alex Antonov
  • 14,134
  • 7
  • 65
  • 142
0

In your table tag,


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