答案 0 :(得分:2)
您可以尝试使用flexbox:
https://jsfiddle.net/87swa6mm/1/
<style>
.box {
background-color: #eee;
padding: 10px;
margin: 10px;
}
.flex-c {
display: flex;
justify-content: center;
}
</style>
<div class="flex-c">
<div class="box">foo</div>
<div class="box">foo</div>
<div class="box">foo</div>
<div class="box">foo</div>
</div>
<div class="flex-c">
<div class="box">foo</div>
<div class="box">foo</div>
<div class="box">foo</div>
</div>
<div class="flex-c">
<div class="box">foo</div>
<div class="box">foo</div>
<div class="box">foo</div>
</div>
答案 1 :(得分:0)
两张桌子......
<table border="1" align="center">
<tbody>
<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr>
</tbody>
</table><table border="1" align="center">
<tbody>
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>1</td><td>2</td><td>3</td></tr>
</tbody>
</table>
&#13;
答案 2 :(得分:0)
我会尝试使用两倍于您想要的列,然后使用colspan="2"
:
.border {
border: 1px solid #000;
}
&#13;
<table>
<tr>
<td class="border" colspan="2">test</td>
<td class="border" colspan="2">test</td>
<td class="border" colspan="2">test</td>
<td class="border" colspan="2">test</td>
</tr>
<tr>
<td></td>
<td class="border" colspan="2">test</td>
<td class="border" colspan="2">test</td>
<td class="border" colspan="2">test</td>
<td></td>
</tr>
</table>
&#13;