반응형
표 셀에서 텍스트의 수직 정렬
다음은 내 테이블의 일부입니다 (양식).

사람들은 단지 두 가지 <td>A의의 <tr>. 설명 을 맨 아래에 놓지 않고 테이블 셀의 맨 위로 가져 오려고 합니다.
어떻게 할 수 있습니까?
td.description {vertical-align: top;}
그 텍스트 description가있는의 클래스 이름은 어디에 있습니까?td
td.description {
vertical-align: top;
}
<td class="description">Description</td>
또는 인라인 (yuk!)
<td style="vertical-align: top;">Description</td>
시험
td.description {
line-height: 15px
}
<td class="description">Description</td>
줄 높이 값을 원하는 값으로 설정합니다.
Bootstrap을 사용하는 경우 테이블에 다음 사용자 정의 스타일 설정을 추가하십시오.
.table>tbody>tr>td,
.table>tbody>tr>th,
.table>tfoot>tr>td,
.table>tfoot>tr>th,
.table>thead>tr>td,
.table>thead>tr>th {
vertical-align: middle;
}
valign="top" 일을해야합니다.
<tr>
<td valign="top">Description</td>
</tr>
나는 같은 문제가 있었지만 !important. .NET의 상속에 대해 잊었습니다 CSS. 먼저 확인해야 할 팁입니다.
모든 td가 아닌 첫 번째 td에 대해 vertical-align : top을 추가하십시오.
tr>td:first-child {
vertical-align: top;
}
<tr>
<td>Description</td>
<td>more text</td>
</tr>
참고URL : https://stackoverflow.com/questions/5943166/vertical-alignment-of-text-in-a-table-cell
반응형
'Program Club' 카테고리의 다른 글
| 대규모 조직에서 Mercurial 사용 (0) | 2020.11.21 |
|---|---|
| 이 해커는 무엇을하려고합니까? (0) | 2020.11.21 |
| android.content.res.Resources $ NotFoundException : 리소스 ID # 0xffffffff를 찾을 수 없습니다. (0) | 2020.11.21 |
| 파이썬 셀레늄 클릭 버튼 (0) | 2020.11.21 |
| user.email 및 user.name을 설정하지 않고 커밋 (0) | 2020.11.21 |