html中table整体缩小,html
您可以使用border-collapse:在表格中折叠.
The border-collapse CSS property selects a table’s border model. This
has a big influence on the look and style of the table cells.
The separated model is the traditional HTML table border model.
Adjacent cells each have their own distinct borders. The distance
between them given by the border-spacing property.
In the collapsed border model, adjacent table cells share borders. In
that model, the border-style value of inset behaves like groove, and
outset behaves like ridge.
没有边框折叠的示例:
tr.alternate {
background-color: #aaa;
}
test | test | test |
test | test | test |
边界折叠示例:
table {
border-collapse: collapse;
}
tr.alternate {
background-color: #aaa;
}
test | test | test |
test | test | test |
如您所见,您不需要为td设置单独的类.
html中table整体缩小,html
您可以使用border-collapse:在表格中折叠.
The border-collapse CSS property selects a table’s border model. This
has a big influence on the look and style of the table cells.
The separated model is the traditional HTML table border model.
Adjacent cells each have their own distinct borders. The distance
between them given by the border-spacing property.
In the collapsed border model, adjacent table cells share borders. In
that model, the border-style value of inset behaves like groove, and
outset behaves like ridge.
没有边框折叠的示例:
tr.alternate {
background-color: #aaa;
}
test | test | test |
test | test | test |
边界折叠示例:
table {
border-collapse: collapse;
}
tr.alternate {
background-color: #aaa;
}
test | test | test |
test | test | test |
如您所见,您不需要为td设置单独的类.