set table row height

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 15:21:25

问题


My lacking skills of CSS is giving me a headache. As presented in this picture below, captured from firebug:

Using a GWT like framework called Vaadin I have given a Table component the class name m2m-modal-table and I want set a min-height to the four rows in that table. However, I can't seem to get it to work.. And as you see from the image the table doesn't even seem to have the class name m2m-modal-table but v-table-table instead (styles are being added outside my involvement since I'm using an already setup framework library).

So, can anyone who has good knowledge of CSS class referring tell me what I should write in the style sheet to set the row height of the table?

Thank you!

EDIT: Thank you avall for the help. And I found that writing the CSS as:

.m2m-modal-table .v-table-table th,
.m2m-modal-table .v-table-table td {
    height: 55px;
    min-height: 55px;
}

Will only set the style on the table in question and not all tables in the application.


回答1:


Always set your height to cells, not rows.

.v-table-table th,
.v-table-table td{
    height: 55px;
    /* min-height: 55px; EDITED */
}

will do (min-height alone doesn't work).

Edit: As djsadinoff wrote, min-height doesn't work everywhere. IE8 and IE9 interpret min-height but it is not the norm for other browsers.



来源:https://stackoverflow.com/questions/7530170/set-table-row-height

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!