div寫自適應表格
阿新 • • 發佈:2019-02-15
<html>
<body>
<div style="display:table;border:1px red solid;width:100%;">
<div style="display:table-caption;text-align:center;">My table</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:0px red solid;">3</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:0px red solid;">3</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:0px red solid;">3</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:0px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:0px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:0px red solid;border-right:0px red solid;">3</div>
</div>
</div>
</body>
</html>
<body>
<div style="display:table;border:1px red solid;width:100%;">
<div style="display:table-caption;text-align:center;">My table</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:0px red solid;">3</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:0px red solid;">3</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:1px red solid;border-right:0px red solid;">3</div>
</div>
<div style="display:table-row;">
<div style="display:table-cell;border-bottom:0px red solid;border-right:1px red solid;">1</div>
<div style="display:table-cell;border-bottom:0px red solid;border-right:1px red solid;">2</div>
<div style="display:table-cell;border-bottom:0px red solid;border-right:0px red solid;">3</div>
</div>
</div>
</body>
</html>