<!DOCTYPE html>  
<html>  
<head>  
    <title>单元格内包含标签和文本框</title>  
    <style>  
        /* 可选的CSS样式,用于美化表格 */  
        table {  
            width: 50%; /* 设置表格宽度为页面宽度的50% */  
            border-collapse: collapse; /* 合并表格边框 */  
        }  
        th, td {  
            border: 1px solid #ddd; /* 为表格单元格设置边框 */  
            padding: 8px; /* 设置单元格内边距 */  
            text-align: left; /* 文本左对齐 */  
        }  
        th {  
            background-color: #f2f2f2; /* 设置表头背景色 */  
        }  
    </style>  
</head>  
<body>  
  
<table>  
    <tr>  
        <th>用户名</th>  
    </tr>  
    <tr>  
        <td>  
            <label for="username">用户名:</label> <!-- 标签,for属性与input的id属性相匹配 -->  
            <input type="text" id="username" name="username" placeholder="请输入用户名"> <!-- 文本框 -->  
        </td>  
    </tr>  
</table>  
  
</body>  
</html>


















![[Unity Demo]从零开始制作空洞骑士Hollow Knight第四集:制作更多的敌人](https://i-blog.csdnimg.cn/direct/8c30067dd7ee4ad0956c7e050494dfc2.png)

