Vertical Alignment of text in a table cell

前端 未结 7 1797
礼貌的吻别
礼貌的吻别 2020-12-03 09:39

Here\'s a portion of my table (it\'s a form):

\"\"

Those are just two \'s in a <

7条回答
  •  清歌不尽
    2020-12-03 10:01

    CSS {vertical-align: top;} or html Attribute {valign="top"}

    .table td, 
    .table th {
        border: 1px solid #161b21;
        text-align: left;
        padding: 8px;
        width: 250px;
        height: 100px;
        
        /* style for table */
    }
    
    .table-body-text {
      vertical-align: top;
    }
    Title 1 Title 2
    text text

    For table vertical-align we have 2 options.

    1. is to use css {vertical-align: top;}
    1. another way is to user attribute "valign" and the property should be "top" {valign="top"}

提交回复
热议问题