table样式设置

admin 38 0

在HTML以下是一些常用的CSS样式设置:

1. 设置表格宽度和边框:

<style>
  table {
    width: 100%;
    border-collapse: collapse;
  }
  th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: left;
  }
</style>

2. 设置表格标题样式:

<style>
  th {
    background-color: #4CAF50;
    color: white;
  }
</style>

3. 设置表格行间距:

<style>
  tr {
    margin-bottom: 10px;
  }
</style>

4. 设置表格单元格对齐方式:

<style>
  td {
    text-align: center; /* 水平居中 */
  }
</style>

5. 设置表格标题对齐方式:

<style>
  th {
    text-align: right; /* 右对齐 */
  }
</style>

这些是一些常用的样式设置,你可以根据需要进行调整和组合。