DIV TABLE (4x4)

丶灬走出姿态 提交于 2019-12-13 22:12:31

问题


I am looking for a div table, with 4 columns and 4 rows.

I would like the width to be 100%, I would like to insert images and text into each div.

Can anyone help?


回答1:


If you need to show tabular data, just use a table. If you want it to be responsive you might use this as a layout: example

.row{
    clear: both;
    width: 100%;
    margin: 0px;
    padding: 0px;
}

.cell{
    float: left;
    min-height: 100px;
    width: 24%;
    border: 1px solid black;
    text-align: center;
    min-width: 100px;
}

Note: I set the minimum width of a cell to 100px so it won't be too small - that's the advantage of using divs instead of a table. If you don't won't the structure to break in small display, you really should use a table.



来源:https://stackoverflow.com/questions/21086682/div-table-4x4

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