I have often used the code below to create a table without using HTML table tags. Perhaps I should consider switching to using the table tag, but that's not the issue at hand.
If the <dd>
tag is empty, the next <dt>
tag will not float left and will be on its own line. However, adding
to the <dd>
tag makes it behave differently.
Why is
necessary, and how can the CSS be modified so that it is no longer needed?
dl.table dt, dl.table dd {
overflow: hidden;
padding-top: 3px;
padding-bottom: 2px;
}
dl.table dt {
float: left;
width: 200px;
}
<dl class="table">
<dt>Title</dt><dd>bla</dd>
<dt>Title</dt><dd>bla</dd>
<dt>Title</dt><dd></dd>
<dt>Title</dt><dd>bla</dd>
<dt>Title</dt><dd>bla</dd>
<dt>Title</dt><dd> </dd>
<dt>Title</dt><dd>bla</dd>
</dl>