我是 CSS 新手,我有一个如下所示的 html 表格
+-------------------------------+---------------------+
|Text Sample | text |
+-------------------------------+---------------------+
|Text Sample Sample | text |
+-------------------------------+---------------------+
我想改变 Text1s 的对齐方式如下:
+-------------------------------+---------------------+
| Text Sample | text |
+-------------------------------+---------------------+
| Text1 Sample Sample | text |
+-------------------------------+---------------------+
这是如何使用 CSS 完成的?
最佳答案
您只是想缩进每个表格行的第一个单元格吗?如果是这样,一种方法是这样的:
tr td:first-child { padding-left: 30px }
(或插入您自己的值)
关于css - 对齐 html 表格内的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14412928/