【发布时间】:2018-01-09 08:48:33
【问题描述】:
有没有人知道如何在单击按钮或角度 2 的某个位置时调整表格或 div 的大小? 当单击使用 CSS 和 typescript 的函数时,我试图调整表格宽度:300px 到 100px。
table{
width: 300px;
resize: horizontal;
border: 2px solid;
}
doResize(): void {
document.getElementById("table").style.resize = "100px horizontal";
}
html
<div class="resizeTable">
<table id="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Price($)</th>
</tr>
</thead>
<tbody>
<tr>
<td>BH12</td>
<td>Shirt</td>
<td>300</td>
</tr>
</tbody>
</table>
</div>
<button click="doResize()"> Rezise </button>
【问题讨论】:
标签: css typescript html-table angular2-template