SPAN Attribute | span Property

Internet Development Index

Sets or retrieves the number of columns in the group.

Syntax

HTML<ELEMENT SPAN = iSpan... >
Scriptingobject.span [ = iSpan ]

Possible Values

iSpanInteger that specifies or receives the number of spanned columns. The default value is 1.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

The span property is ignored when set on the colGroup element and colGroup contains one or more col elements. The span property provides a more convenient way of grouping columns without having to specify col objects.

Example

This example sets the SPAN attribute of the col object to two, which causes the col to span two columns. The text is right-aligned in these two columns.

<TABLE BORDER>
<COLGROUP>
<COL SPAN=2 ALIGN=RIGHT>
<COL ALIGN=LEFT>
<TBODY>
<TR>
<TD>This is the first column in the group, and it is
right-aligned.</TD>
<TD>This is the second column in the group, and it is
right-aligned.</TD>
<TD>This is the third column in the group, and it is
left-aligned.</TD>
</TR>
</TABLE>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This property is defined in HTML 4.0 Non-Microsoft link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

COL, COLGROUP