Align text in a table header

后端 未结 8 2149
生来不讨喜
生来不讨喜 2021-02-06 20:37

It seems align is not working for the th element. Here is my HTML:

相关标签:
8条回答
  • 2021-02-06 21:05

    If you want to center the th of all tables:
    table th{ text-align: center; }

    If you only want to center the th of a table with a determined id:
    table#tableId th{ text-align: center; }

    0 讨论(0)
  • 2021-02-06 21:06

    Try using style for th

    th {text-align:center}
    
    0 讨论(0)
提交回复
热议问题