XUL Programmer's Reference Manual

<tab>

Attributes Common Children
value * * *
style  
selected  
orient  
autostretch  
oncommand  

 
<tab> is the actual tab in the tab set. The name of the tab is taken from the content rather than an attribute, and the tab sizes automatically to fit the tab name. The <tab> widget does not inherit from box, but it can be styled like any XUL widget. Style information for the tab widget is contained in the global.css file for Mozilla.
 
 
<tabcontrol align="vertical">
   <tabbox align="horizontal">
         <tab value="Tab One" />
         <tab value="Tab Two" />
         <tab value="Tab Three" />
   </tabbox>
   <tabpanel flex="100%">
         <text value="View
One"/>
         <text value="View
Two"/>
         <text value="View
Three"/>
   </tabpanel>
 </tabcontrol>

 
 
value

Description

The value attribute specifies the text for a tab.

Syntax

<tab value="string" />

Example

<tab value="Options" />

Notes

The use of the <tab element as a container for the actual text of the tab (i.e., <tab>Options</tab>) is no longer legal in XUL. The tab widget, like most of the widgets in the toolkit, inherits from box and uses attributes like value to manage labels and text.
 
selected

Description

The selected attribute specifies whether a given treeitem is pre-selected or not.

Syntax

<treeitem selected="true | false" />

Example

<tab value="index" selected="true" />

Notes

You can get and set the selected attribute using the DOM:
tb = document.getElementById("tab1")
tb.setAttribute("selected", "true")
 

 

Last updated: 3/27/00 Ian Oeschger