YouTip LogoYouTip

Prop Colgroup Span

# Columngroup span Attribute [![Image 8: Columngroup Object Reference](#) Columngroup Object](#) ## Example Return the number of columns spanned by the element: var x = document.getElementById("myColgroup").span; The _x_ output will be: 2 [Try it Β»](#) * * * ## Definition and Usage The span property sets or returns the value of the span attribute of a column group. The span attribute defines the number of columns a element should span. **Tip:** To describe the attributes of different column elements within a , use the (#) object. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The span attribute is supported by all major browsers. * * * ## Syntax Return the span property: _columngroupObject_.span Set the formMethod property: _columngroupObject_.span=_number_ ## Property Values | Value | Description | | --- | --- | | number | Specifies the number of columns a element should span. | ## Technical Details | Return Value: | Returns the number of columns | | --- | * * * ## More Examples ## Example Use the span and backgroundColor properties to set the background color of the first two columns to red: document.getElementById("myColgroup").span="2"; document.getElementById("myColgroup").style.backgroundColor="red"; [Try it Β»](#) * * * ## Related Pages HTML Reference: [HTML span Attribute](#) * * Columngroup Object](#)
← Dom Obj DelDom Obj Colgroup β†’