XUL:listcell
From MDC
« XUL Reference home [ Examples | Attributes | Properties | Methods | Related ]
A single cell of a listbox. By default it only contains text but iconic and checkbox listcells are also available.
- Properties
- disabled
- Style classes
- listcell-iconic,
[edit] Examples
(example needed)
[edit] Attributes
|
Inherited from XUL element |
- crop
- Type: one of the values below
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the
cropattribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.
-
start: The text will be cropped on its left side. -
end: The text will be cropped on its right side. -
left: Deprecated The text will be cropped on its left side. -
right: Deprecated The text will be cropped on its right side. -
center: The text will be cropped in the middle, showing both the start and end of the text normally. -
none: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.
- disabled
- Type: boolean
- Indicates whether the element is disabled or not. If this element is set to
truethe element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and thecommandevent will not fire.
- image
- Type: image URL
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the dir and orient attributes.
- label
- Type: string
- The label that will appear on the element. If this is left out, no text appears.
- type
- Type: string
- You can make a cell in a listbox a checkbox by setting this attribute's value to
checkbox.
[edit] Properties
|
Inherited from XUL element Inherited from DOM element |
[edit] Methods
|
Inherited from XUL element Inherited from DOM element |
[edit] Style classes
- listcell-iconic
- Use this class to have an image appear on the listcell. Specify the image using the image attribute. Note that both an image and a label are added when this style is set. The label will take up extra space even when no label text is set. If it is desired to center the image, use CSS to hide the label.
[edit] Tips
If you need to right-align a cell's contents, you can do so like this:
cell = document.createElement("listcell");
cell.setAttribute("label", "This is the cell's label");
cell.setAttribute("style", "text-align:right");