0
A
回答
0
window.onresize = function() {
var x = document.getElementsByClassName("cell");
var _size = document.getElementById("myTable").offsetWidth/160 + "px";
for(var i = 0; i < x.length; i++) {
x[i].style.borderWidth = _size;
x[i].style.height = x[i].offsetWidth + "px";
}
};
table {
\t width: 100%;
\t border-collapse: collapse;
}
table td {
\t width: 25%;
\t border: 1px solid black;
}
table tr:first-child td {
\t border-top: 0;
}
table tr:last-child td {
\t border-bottom: 0;
}
table tr td:first-child {
\t border-left: 0;
}
table tr td:last-child {
\t border-right: 0;
}
<table id="myTable">
<tr>
<td class="cell">1</td>
<td class="cell">2</td>
<td class="cell">3</td>
<td class="cell">4</td>
</tr>
<tr>
<td class="cell">5</td>
<td class="cell">6</td>
<td class="cell">7</td>
<td class="cell">8</td>
</tr>
<tr>
<td class="cell">9</td>
<td class="cell">10</td>
<td class="cell">11</td>
<td class="cell">12</td>
</tr>
<tr>
<td class="cell">13</td>
<td class="cell">14</td>
<td class="cell">15</td>
<td class="cell">16</td>
</tr>
</table>
-1
找到這條路徑來獲得表CSS的整個知識
https://css-tricks.com/complete-guide-table-element/
+0
我沒有找到那裏 –
+0
請提供代碼不是一個細節。 –
相關問題
- 1. 父/子造型CSS
- 2. HTML CSS:破桌子?
- 3. IMG造型CSS
- 4. Header造型CSS
- 5. JFXtras css造型
- 6. 造型Joomla內容 - 下降帽子CSS
- 7. CSS - 造型形式
- 8. css邊框造型
- 9. css造型按鈕
- 10. JavaFX和CSS造型
- 11. MVC3 CSS Textbox造型
- 12. HTML CSS框造型
- 13. 側欄造型CSS
- 14. CSS造型消失
- 15. 的CSS格造型
- 16. CSS的float造型
- 17. 幻影邊界桌子裏面的桌子Css
- 18. 造型子菜單
- 19. 造型UIButtons - 子類?
- 20. CSS:造型範圍輸入?
- 21. Bootstrap CSS造型問題
- 22. CSS等待吧?造型
- 23. 造型與CSS或JavaScript
- 24. 造型圖像與CSS
- 25. CSS div表格造型
- 26. CSS最後UL造型
- 27. css造型表問題
- 28. HTML - CSS:造型<object>?
- 29. 造型與標準的CSS
- 30. CSS造型多個元素
@Rahul Tripathi Thx編輯! –
它需要成爲一張桌子嗎?你可以使用畫布嗎? – CR41G14
@ CR41G14不,這不只是一個形狀,細胞將包含圖像,用戶將點擊它們 –