HTML表提供了显示文本、数据和其他元素的功能。在使用表格时,我们可能希望表格或表格内容居中。居中的桌子和它的内容将居中,看起来很漂亮。
null
带左边距和右边距的中间表格 属性
创建HTML表格中心的第一种方法是使用 margin-left
和 margin-right
CSS属性。我们可以将这些属性设置为 auto
或相同的值以使桌子居中。
Name | Surname |
---|---|
İsmail | Baydan |
Ahmet Ali | Baydan |
Elif Ecrin | Baydan |
将表格内容居中对齐属性
table HTML元素提供 align
属性,该属性将对齐表。align属性可以得到 right
, left
和 center
价值观。在下面的示例中,我们将设置 align
属性为 center
.
Name | Surname |
---|---|
İsmail | Baydan |
Ahmet Ali | Baydan |
Elif Ecrin | Baydan |
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END