Difference between revisions of "Template:Clade label/doc"

From blackwiki
Jump to navigation Jump to search
imported>Jts1882
(Created page with '{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> Th...')
 
imported>Jts1882
(add example)
Line 4: Line 4:
 
This is a utility template for labelling cladograms made with the {{tl|clade}} template. In particular it is for use with {{para|labelN}} and {{para|sublabelN}} to enable long labels without stretching the cladogram horizontally.
 
This is a utility template for labelling cladograms made with the {{tl|clade}} template. In particular it is for use with {{para|labelN}} and {{para|sublabelN}} to enable long labels without stretching the cladogram horizontally.
  
 +
== Usage ==
 +
 +
<pre>{{clade label|long label that doesn't stretch the cladogram}}</pre>
 +
 +
This returns a label in a <code>div</code> element that is positioned absolutely against the right edge of a parent <code>div</code> element.
  
== Usage ==
+
==Example==
  
 +
<pre>{{clade |style=float:right;
 +
|label1=root
 +
|1={{clade
 +
  |1=Leaf 1
 +
  |2={{clade
 +
      |1=Leaf 2&nbsp;
 +
      |sublabel2={{clade label|long label that doesn't stretch the cladogram}}
 +
      |2={{clade
 +
        |1=Leaf 3&nbsp;
 +
        |2=Leaf 4
 +
        }}
 +
      }}
 +
  }}
 +
}}</pre>
 +
{{clade |style=float:right;
 +
|label1=root
 +
|1={{clade
 +
  |1=Leaf 1
 +
  |2={{clade
 +
      |1=Leaf 2&nbsp;
 +
      |sublabelstyle2=overflow:auto; <!--temporary requirement-->
 +
      |sublabel2={{clade label|long label that doesn't stretch the cladogram}}
 +
      |2={{clade
 +
        |1=Leaf 3&nbsp;
 +
        |2=Leaf 4
 +
        }}
 +
      }}
 +
  }}
 +
}}
  
  

Revision as of 13:50, 8 January 2020

This is a utility template for labelling cladograms made with the {{clade}} template. In particular it is for use with |labelN= and |sublabelN= to enable long labels without stretching the cladogram horizontally.

Usage

{{clade label|long label that doesn't stretch the cladogram}}

This returns a label in a div element that is positioned absolutely against the right edge of a parent div element.

Example

{{clade |style=float:right;
|label1=root
|1={{clade
   |1=Leaf 1 
   |2={{clade
      |1=Leaf 2  
      |sublabel2={{clade label|long label that doesn't stretch the cladogram}}
      |2={{clade
         |1=Leaf 3  
         |2=Leaf 4 
         }}
      }}
   }}
}}
root

Leaf 1

Leaf 2 

Leaf 3 

Leaf 4

long label that doesn't stretch the cladogram