Class Dl<T extends Dl<T>>


public class Dl<T extends Dl<T>> extends StyledElement<T>
Represents an HTML <dl> element for description lists.

The Dl (Description List) element encloses a list of groups of terms (specified using Dt) and descriptions (specified using Dd). Common uses include implementing a glossary or displaying metadata.

Features:

  • Contains term-description pairs
  • Uses dt (term) and dd (description) children
  • Useful for glossaries and metadata
  • Flexible term-to-description ratios

Usage:


 Dl dl = new Dl();
 dl.addDefinition(new Dt("HTML"));
 dl.addDescription(new Dd("HyperText Markup Language"));
 dl.addDefinition(new Dt("CSS"));
 dl.addDescription(new Dd("Cascading Style Sheets"));
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Dl

      public Dl()
      Constructs an empty <dl> element.
  • Method Details

    • addDefinition

      public void addDefinition(Dt dt)
      Adds a definition term to the description list.
      Parameters:
      dt - the Dt element containing the term
    • addDescription

      public void addDescription(Dd dd)
      Adds a description to the description list.
      Parameters:
      dd - the Dd element containing the description
    • removeAllElements

      public void removeAllElements()
      Removes all definition terms and descriptions from this list.
      Overrides:
      removeAllElements in class Element<T extends Dl<T>>