The following describes how to style a tree.
Styling the Tree
You can style the tree border and the column headers in the same way as other elements. Style added to the ref_treetree element will apply to the entire tree. Adding a style to the ref_treecoltreecol element does not cause the style to be applied to the column but only to the header.
The body of the tree must be styled in a somewhat different way than other elements. This is because the tree body is stored in a different way to other elements. The outer ref_treechildrentreechildren is the only real element in the tree body. The inner elements are just placeholders.
Instead, you must use the properties attribute on the rows or cells to set one or more named properties. This can be used with trees with static content, RDF built content or with those with a custom view. Let's say we want to give a particular row have a blue background color. This would be used to implement Mail's labels feature. We'll use a property called 'makeItBlue'. You can use whatever name you want. You can set multiple properties by separating them with spaces.
Set the property on a row or cell, as in the following example:
The style sheet can take this property and use it to change the appearance of the row for unread messages or labels. You can think of the properties as functioning much like style classes, although they require a somewhat more complex syntax to use in a style sheet. This is because you can specify the style for a number of parts of the cell individually. You can style not only the cell and its text, but the twisty and indentation. The following is the syntax that needs to be used:
This extra pseudostyle is used to style the background color of rows that have the 'makeItBlue' property. This special syntax is needed because the cells themselves are not separate elements. All of the content inside the tree's body is rendered by the ref_treechildrentreechildren element. (Note the treechildren is being styled in the rule above.) The pseudostyle sets style rules for particular parts of what it displays. This style rule means, inside a treechildren element, set the background color to blue for all tree rows that have the 'makeItBlue' property.
The text '::-moz-tree-row' specifies what content area is desired, which in this case is a row. You can also use the following values:
- ::-moz-tree-cell: a cell. Use this to set borders and background colors.
- ::-moz-tree-cell-text: the text in a cell. Use this to set the font and text color.
- ::-moz-tree-twisty: the appearance of the twisty used to expand and collapse child rows.
- ::-moz-tree-image: the image for a cell. You can set the image with the list-style-image property.
- ::-moz-tree-row: a row. Use this to set the background color of a row.
- ::-moz-tree-indentation: the indentation to the left of rows that are children of other rows.
- ::-moz-tree-column: a column.
- ::-moz-tree-line: the lines that are drawn to connect child rows to parent rows.
- ::-moz-tree-separator: a separator in a tree.
- ::-moz-tree-progressmeter: content for progressmeter cells. You can create a progressmeter column by setting the type attribute on the column to progressmeter.
- ::-moz-tree-drop-feedback: the drag and drop feedback.
You can check for multiple properties by separating them with commas. The example below sets the background color to grey for rows that have the 'readonly' and 'unread' properties. For properties that are 'readonly', it adds a red border around the row. Note that the first rule will apply to any row that is 'readonly' regardless of whether other properties such as 'unread' are set.
The properties list for tree elements contain a small number of properties, which you can also use in a style sheet. You can use these extra properties to set the appearance of containers or selected rows. The following properties are automatically set as needed:
- focus: this property is set if the tree currently has the focus.
- selected: this property is set for rows or cells that are currently selected.
- current: this property is set if the cursor is at the row. Only one row will have this property set at a time.
- container: this property is set for rows or cells that have child rows.
- leaf: this property is set for rows or cells that do not have child rows.
- open: this property is set for rows or cells which are expanded.
- closed: this property is set for rows or cells which are collapsed.
- primary: this property is set for cells in the primary column.
- sorted: this property is set for cells in the current sorted column.
- even: this property is set for even numbered rows.
- odd: this property is set for odd numbered rows. This property, along with the even property allow you to set, for example, alternating colors for each row.
- dragSession: this property is set if something is currently being dragged.
- dropOn: if a drag is occuring over the tree, this property is set
for to drop
Bhopal news
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100