Display DL like a table

11,210

Try this.

dt  {
    clear:left;
    float:left;
    font-size:12px;
    line-height:26px;
    width:70px;
}

dd {
    clear:right;
    font-size:12px;
    line-height:18px;
    padding:4px 0 4px 40px;
}
Share:
11,210
takeshin
Author by

takeshin

Updated on June 01, 2022

Comments

  • takeshin
    takeshin about 2 years

    How to style definition list items to have each definition in one line?

    HTML:

    <dl>
        <dt>word</dt><dd>meaning</dd>
        <dt>word</dt><dd>meaning</dd>
        <dt>word</dt><dd>meaning</dd>
    </dl>
    

    Visual rendering I need:

    *word* meaning
    *word* meaning
    *word* meaning
    
  • takeshin
    takeshin almost 14 years
    Thanks, this works in my Firefox (haven't tested other).
  • jpeltoniemi
    jpeltoniemi almost 9 years
    Unfortunately this wouldn't scale with content like table does