格式化表格

作为选项,表格的第一行可以包含一些对于表格格式的定义:border, width, alignment, bgcolor, cellpadding, cellspacing。Width 可以按照百分比或者像素定义。Colors 可以按照颜色的名则或者 HTML 代码定义。Cellpadding 是表格内容和边框的距离;cellspacing 是表格之间的距离。

例子 1. 改变宽度和对齐方式

这个标记:

    
    || border=10 align=center
    || cell 1 || cell 2 || cell 3 ||
    || cell 1 || cell 2 || cell 3 ||

创造了这样的表格:

cell 1cell 2cell 3
cell 1cell 2cell 3

例子 2. 改变颜色

这个标记:

    
    || border=1 bgcolor=red align=center
    || cell 1 || cell 2 || cell 3 ||
    || cell 1 || cell 2 || cell 3 ||

创造了这样的表格:

cell 1cell 2cell 3
cell 1cell 2cell 3

例子 3. 按照百分比改变宽度

这个标记:

    
    || border=1 width=100% bgcolor=yellow
    || cell 1 || cell 2 || cell 3 ||
    || cell 1 || cell 2 || cell 3 ||

创造了这样的表格:

cell 1cell 2cell 3
cell 1cell 2cell 3

例子 4. 按照像素改变宽度,按照 HTML 代码改变颜色

这个标记:

    
    || border=1 width=350 bgcolor=#CCCCCC align=center
    || cell 1 || cell 2 || cell 3 ||
    || cell 1 || cell 2 || cell 3 ||

创造了这样的表格:

cell 1cell 2cell 3
cell 1cell 2cell 3

例子 5. 改变 cellpadding

这个标记:

    
    || border=1 width=350 cellpadding=10 align=center
    || cell 1 || cell 2 || cell 3 ||
    || cell 1 || cell 2 || cell 3 ||

创造了这样的表格:

cell 1cell 2cell 3
cell 1cell 2cell 3

例子 6. 改变 cellspacing.

这个标记:

    
    || border=1 width=350 cellspacing=10 align=center
    || cell 1 || cell 2 || cell 3 ||
    || cell 1 || cell 2 || cell 3 ||

创造了这样的表格:

cell 1cell 2cell 3
cell 1cell 2cell 3

<< | PmWiki.DocumentationIndex | >>

This page may have a more recent version on pmwiki.org: PmWiki:SimpleTables2, and a talk page: PmWiki:SimpleTables2-Talk.

GlossyBlue theme adapted by David Gilbert
Powered by PmWiki