html之colspan && rowspan讲解
1.colspan && rowspan均在td标签中使用
2.每个单元格大小一致的前提
<table border="1" bordercolor="red">
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
</table>
效果:

colspan属性代码:
<table border="1" bordercolor="red">
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
<tr>
<td colspan="3">nokiacomputer</td>
</tr>
</table>
效果:

全面举例说明:
一行一列的表格:
<table>
<tr>
<td></td>
</tr>
</table>
一行两列的表格:
<table>
<tr>
<td></td>
<td></td>
</tr>
</table>
一行三列的表格:
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
两行一列的表格:
<table>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
两行两列的表格:
<table>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
有趣的现象:
<table border="1" bordercolor="red">
<tr>
<td rowspan="2">nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
</table>
效果:

而在第二行去掉一个<td>nokiacomputer</td>时 ,
代码如下:
<table border="1" bordercolor="red">
<tr>
<td rowspan="2">nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
<tr>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
<td>nokiacomputer</td>
</tr>
</table>
效果:

为什么多一列时会自动向后排?
多两列时会不会也是这样的?
效果:

果然如此!
html之colspan && rowspan讲解的更多相关文章
- IE下默认TD colspan rowspan值为1
IE下默认TD colspan rowspan值为1,即使这个TD没有合并没有rowspan,colspan属性,其值都为1,chrome下正常. 判断是否rowspan colspan为TD.get ...
- table表格中的 colspan rowspan cellpadding cellspacing
横跨两列的单元格: colspan 属性规定单元格可横跨的列数 colspan="2" <table border="1"> <tr> ...
- jQuery Table2CSV插件(表格转CSV) 完美支持colspan和rowspan
table2csv:将表格转化为csv数据 参数:一个JSON对象 { 'repeatChar':'拆分单元格填充字符', //默认为null则将单元格值填充到拆分的每个单元格中,如果给定字符串则用给 ...
- C# Html格式内容转Csv内容包括table(重点在rowspan和colspan合并),p,div元素
Html格式内容转Csv内容,包括table(重点在rowspan和colspan合并),p,div元素,table不能包含嵌套功能. /// <summary> /// Html格式内容 ...
- <table>标签总结(colspan跨列 ,rowspan跨行)
table标签有些内置属性要设置: <table cellpadding="0" cellspacing="0" border="0" ...
- 全面系统讲解CSS工作应用+面试一步搞定
[TOC] 一.课程介绍 二.HTML基础强化 html常见元素和理解 html常见元素分类 head区元素:(不会在页面上留下元素) * meta * title * style * link * ...
- 冰冻三尺非一日之寒--web来了
第十四章 html css 1-1Html和CSS的关系学习web前端开发基础技术需要掌握:HTML.CSS.JavaScript语言.下面我们就来了解下这三门技术都是用来实现什么的:1. H ...
- Windows Community Toolkit 3.0 - UniformGrid
概述 UniformGrid 控件是一个响应式的布局控件,允许把 items 排列在一组均匀分布的行或列中,以填充整体的可用显示空间,形成均匀的多个网格.默认情况下,网格中的每个单元格大小相同. 这是 ...
- Python 21 Django 实用小案例1
实用案例 验证码与验证 KindEditor 组合搜索的实现 单例模式 beautifulsoup4 验证码与验证 需要安装Pillow模块 pip stall pillow ...
随机推荐
- cursorfilter
android.widget.CursorAdapter它首先实现了两个接口Filterable,CursorFilter.CursorFilterClient.其中Filterable接口定义了ge ...
- eclipse使用快捷键
注意热键冲突 内容补全键 Alt+/ 快速修复键 ctrl+1 代码移动 Alt+上下键(选中代码块) 左右移动 tab(右边)Shift+tab( ...
- nexcel 读取 excel
procedure TfrmUserV3.ImportUser(const AFileName: string); var book :IXLSWorkBook; ws : IXLSWorkSheet ...
- C# 调用系统API 内核 简单样例
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.R ...
- 关于js中this的疑问
学习bootstrap.js源码中被js里边的this绕的有点晕 /* ================================================================ ...
- for xml path('') 引发的数据不完整
When you read Extensible Markup Language (XML) data from Microsoft SQL Server by using the SqlDataRe ...
- sizeclass
横竖9种组合,代表所有大小屏幕,在storyboard中可以把contrans与不同组合绑定,也就是说,可能横向有多一个约束,纵向就没了... 实现不同屏幕不同约束,这应该是sizeclass 的存在 ...
- (转)Android网络命令
转自:http://www.cnblogs.com/shunyao8210/archive/2010/08/10/1796214.html ifconfig 1. 作用 ifconfig用 ...
- hdu1007
Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some ...
- Gearman 安装使用教程
Gearman是一个分发任务的程序框架,可以用在各种场合,Gearman更偏向于任务分发功能.它的任务分布非常简单,简单得可以只需要用脚本即可完成. Gearman 分布式任务实现原理上只用到2个字段 ...