HTML表格专有属性和CSS
HTML表格很容易上手,一堆tr加td就可以显示一张表格了。复杂一点就是再加上th,colgroup,tbody,tfooter,caption之类。这些HTML里面的各种元素的确加强了表格的实用性和语义化,但table本身就有很大学问哦,毕竟是整个表格的根啊!
今天下面要总结包含对table本身的属性归纳和table专用的CSS比较:
attributes VS CSS properties
第一个比较容易混淆的是table的border属性和CSS中的border:
Attribute
border='1' //Sets or retrieves the width of the border to draw around the object.
CSS
border-style:solid; //only set the border of the table, NOT the border inside table
border-width:1px;
border-color:#ccc;
if you set the border like table.border = 2; it will refer to the first border
第二个是Cellspacing和border-spacing
Attribute
cellspacing Sets or retrieves the amount of space between cells in a table.
CSS
border-spacing:20px; the same as cellspacing, NOT for IE7/6
this two will work only if the border-collapse is separate
第三个是cellPadding,只有属性,没有对应的CSS
cellpadding: Sets or retrieves the amount of space between the border of the cell and the content of the cell.
there is no CSS property can do this
第四个table专有CSS:border-collapse, 决定border是独立还是聚拢
CSS border-collapse:collapse/separate;
This declaration takes two values:
1. separate: keep borders separate. This is the default.
2. collapse: merge borders of adjoining cells.
第五个table专有CSS: empty-cells
CSS empty-cells
empty-cells is not supported by IE.
This declaration takes two values:
1. show: show empty cells (with a border). This is the default.
2. hide: hide empty cells.
第六个table专有CSS:caption-side
CSS caption-side
Not supported by IE Windows.
Mozilla supports two extra values.
caption-side takes four values, even though W3C specifies only the first two:
top. This is the default.
bottom. This is the other official value.
left. Mozilla extension.
right. Mozilla
相关文档:
什么是XHTML?与HTML相比XHTML有什么特点?
HTML是一种基本的WEB网页设计语言,XHTML是一个基于XML的置标语言,看起来与HTML有些相象,只有一些小的但重要的区别。本文简单介绍什么是XHTML,以及与HTML相比XHTML有什么特点。
1、什么是XHTML?
HTML是一种基本的WEB网页设计语言,XHTML是一个基于XML的置标语 ......
*页面的开头
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
<%@ taglib uri="http://jsftutorials.net/htmLib" prefix="htm"%>
<%@ tagl ......
在开发过程中,很可能会遇到需要过滤掉字符串中的样式代码或者换行回车符等等的情况,我就遇到过类似的情况,所以就把过滤掉html代码的方法贴到博客上,留个标记,希望会对朋友们有所帮助:
String str = "<p>dfsdsdfsdf</p>sdgfsg<b>sdgfsdgrrytrfh</b>\r\r\n";
String ss = str.replaceAl ......
下面是一个过滤html元素的程序,也许对大家有点帮助!
/**
* filter all html element.
* For example:<a href="www.sohu.com/test">hello!</a>
* The filter result is :hello!
  ......
有關html窗體框架的問題,如果想要實現在一個畫面中分割窗體,並且通過點擊其中的一個窗體,鏈接內容至同一個畫面中的另一個窗體。就需要使用<frameset>與<frame>的 ......