在我的角度应用程序中,我有一个代表一个html表的组件.我遇到的问题是我无法降低细胞高度.好像我的css对显示器没有影响.
这里标题&我的component.ts中的catNames var:
catNames : string[] = ["Toto","Tata","Titi","Mama","Momo"]; headers: string[] = ["Head1","Head2","Head3","Head4","Head5"];
这是我的组件HTML:
<table> <tr> <th *ngFor="let header of headers"> {{header}} </th> </tr> <tr> <td *ngFor="let cat of catNames"> <p>{{cat}}</p> </td> </tr> </table>
这是我的CSS:
table { font-family: 'Gill Sans','Gill Sans MT',Calibri,'Trebuchet MS',sans-serif; border-collapse: collapse; text-align: center; width: 100%; font-size: 12pt; } th { border: 1px solid #dddddd; text-align: center; padding: 0px; color: white; background-color: dodgerblue; } td { display:table-cell; border: 1px solid #dddddd; text-align: center; margin: 0; padding: 0; border-spacing: 0; }
我的CSS值有错吗?