---
title: "html 表格嵌套"
author: "秦瑶123"
date: "2015-05-11T22:59:57Z"
tags: []
categories: ["Web前端"]
slug: "html"
draft: false
lastmod: "2015-05-12T09:45:52Z"
id: 2210342
url: "https://654097375.iteye.com/blog/2210342"
---

表格的嵌套就是表格里再有表格，表格的嵌套作用一方面是外观更为漂亮，另一面出于布局的需要，或者两者皆有。只要在外表格（最外面的表格）的&lt;td&gt;&lt;/td&gt;标签间加入对应的table标签就行。

```
<table border=8 bordercolor=#u0099cc width=100%>
<tbody>
  <tr>
   <td>Table No.1(Father Table)
    <table border=8 bordercolor=#ccffcc width=100%>
     <tbody>
      <tr>
       <td><br>Table No.2(Son Table)<br></td>
      </tr>
     </tbody>
    </table>
    Table No.1(Father Table)
   </td>
  </tr>
</tbody>
</table>
```

 

如果要使外表格里有里表格（表格里面的表格）一上一下分布：只要在外表格的&lt;td&gt;&lt;/td&gt;标签间加入多个对应的table标签就行

```
<table border=6 bordercolor=#888888 width="100%">
  <tbody><tr><td>
    <table border=5 bordercolor=#ffcc00 width="100%" height=200>
       <tbody><tr><td></td></tr></tbody>
    </table>
    <table border=5 bordercolor=#ffcc00 width="100%" height=200>
       <tbody><tr><td></td></tr></tbody>
    </table>
  </td></tr></tbody>
</table>
```

 如果要使外表格里 有里表格在一行：只要在外表格的多个&lt;td&gt;&lt;/td&gt;标签间加入对应的table标签就行

```
<table border=6 bordercolor=#888888 width="100%">
  <tbody><tr><td>
    <table border=5 bordercolor=#ffcc00 width="100%" height=200>
       <tbody><tr><td></td></tr></tbody>
    </table></td>

  <td>
    <table border=5 bordercolor=#ffcc00 width="100%" height=200>
      <tbody><tr><td></td></tr></tbody>
    </table>
  </td></tr></tbody>
</table>
```