table标签的td如何横向、纵向合并?
1个回答
展开全部
colspanrowspan
两个参数,
colspan是合并td,
rowspan是合并tr,
例如:<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>123</title> <style type="text/css"> .mTable{width:200px;border:1px solid #666;border-collapse:collapse} .mTable td{border:1px solid #666} </style> </head> <body> <table width="200" cellspacing="0" cellpadding="0" class="mTable"> <tr> <td width="60">姓名:</td> <td width="140">某某</td> </tr> <tr> <td colspan="2">个人简介</td> </tr> </table>
<table width="200" cellspacing="0" cellpadding="0" class="mTable"> <tr> <td width="60">姓名:</td> <td width="140">某某</td> </tr> <tr> <td colspan="2">个人简介个人简介个人简介</td> </tr> </table> </body> </html>
两个参数,
colspan是合并td,
rowspan是合并tr,
例如:<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>123</title> <style type="text/css"> .mTable{width:200px;border:1px solid #666;border-collapse:collapse} .mTable td{border:1px solid #666} </style> </head> <body> <table width="200" cellspacing="0" cellpadding="0" class="mTable"> <tr> <td width="60">姓名:</td> <td width="140">某某</td> </tr> <tr> <td colspan="2">个人简介</td> </tr> </table>
<table width="200" cellspacing="0" cellpadding="0" class="mTable"> <tr> <td width="60">姓名:</td> <td width="140">某某</td> </tr> <tr> <td colspan="2">个人简介个人简介个人简介</td> </tr> </table> </body> </html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询