求解CSS中表格的scope="col"是什么意思。。。。

html-css010

求解CSS中表格的scope="col"是什么意思。。。。,第1张

Scope属性定义了行的表头和列的表头:col: 列表头 row: 行表头在第一行的加上值为col的scope属性,声明他们是下面(列)数据单元格的表头。同样的,给每行的开头加上值为row的scope属性声明他们是右边(行)数据单元格的表头。Scope属性还有两个值:colgroup: 定义列组(column group)的表头信息 rowgroup: 定义行组(row group)的表头信息

<html>

<head><title>HTML

Table</title></head>

<style

type="text/css">

TABLE

{

border-collapse:

separate

border:

2px

solid

blue

}

.one{

border-left:none

border-right:1px

solid

#f00

border-top:1px

solid

#f00

border-bottom:1px

solid

#f00}

</style>

<body>

<table

summary="TechRepublic.com

-

Tables

and

CSS">

<thead><tr>

<thabbr="salesperson"

scope="col">Person</th>

<thabbr="sales"

scope="col">Sales</th>

</tr></thead>

<tbody><tr>

<td

class="one">Mr.

Smith</td>

<td>600.00</td>

</tr><tr>

<td>Mr.

Jones</td>

<td>0000.00</td>

</tr><tr>

<td>Ms.

Williams</td>

<td

class="one">0000.00</td>

</tr></tbody>

<tfoot><tr>

<td>Let's

sale,

sale,

sale!</td>

</tr></tfoot></table></body></html>

我设置了一个样式one,单元格左边没有边框,上下和右边有边框,颜色你可以自己设置。

1、将css写成jsp的格式,动态生成css

<%@ page contentType="text/csscharset=utf-8" pageEncoding="utf-8" %>

<% // 从数据库或配置文件读取系统管理员设置的系统参数 %>

body { background: <%= bodyBackground %>} /* 应用参数 */

...

2、如要换肤之类,样式修改比较多,应用较多页面的情况,建议将不同样式写入不同的CSS文件,通过jsp/servlet将css的选择参数写入session或application,然后在jsp中判断进行选择

<c:if test='${not empty param.theme}'><c:set var='css' scope='session'>${param.theme}</c:set></c:if>

<link rel="stylesheet" type="text/css" href="<c:url value='/css/${session.css}.css'/>"></link>