{"id":462,"date":"2011-12-09T11:48:20","date_gmt":"2011-12-09T11:48:20","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=462"},"modified":"2011-12-09T11:48:30","modified_gmt":"2011-12-09T11:48:30","slug":"dl-html-tag","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/dl-html-tag\/","title":{"rendered":"The case for DL"},"content":{"rendered":"<p>It&#39;s not news to any web developer that table-based layouts are way out of style. Tables were originally intended for tabular data, or data in which the rows are related to each other.<\/p>\n<p>There is a case to made for tables though.<\/p>\n<ul>\n<li>The columns automatically size to make the best use of horizontal space available.<\/li>\n<li>There are many JavaScript solutions available for quick sorting of table rows.<\/li>\n<li>They provide a solution for displaying multiple columns of data without the use of CSS.<\/li>\n<\/ul>\n<p>But, if the none of the above apply to your particular set of data, you might find yourself more comfortable inside the <strong>definition list<\/strong> (DL). The definition list makes sense, in most cases, where the data values are unrelated to each other.<\/p>\n<p>For instance, if you were to display a list of temperature highs and lows for each day over the past month, a three column <strong>table <\/strong>makes sense, as the only unit is temperature, and it makes for easy sorting of the data.<\/p>\n<p>However, if you are displaying information about a person&nbsp; (height, weight, age, etc.), the units are completely unrelated (inches\/feet\/meters, lbs\/kg, years, etc), and hence gain no value from being placed in a <strong>table<\/strong>.<\/p>\n<p>The <strong>definition list <\/strong>however, was designed for this type of information. Each definition list can contain children called terms (DT) and definitions (DD). It&#39;s easy to see the maintenance advantage over tables:<\/p>\n<p><code>&lt;dl&gt;<br \/>\n\t&lt;dt&gt;Name&lt;\/dt&gt;<br \/>\n\t&lt;dd&gt;Bob Smith&lt;\/dd&gt;<br \/>\n\t&lt;dt&gt;Height&lt;\/dt&gt;<br \/>\n\t&lt;dd&gt;5&#39;7&quot;&lt;\/dd&gt;<br \/>\n\t&lt;dt&gt;Age&lt;\/dt&gt;<br \/>\n\t&lt;dd&gt;33&lt;\/dd&gt;<br \/>\n\t&lt;\/dl&gt;<br \/>\n\t<\/code><\/p>\n<p>With just a little CSS, we can even mimic the look of a table:<\/p>\n<p><code>dl { margin-bottom: 50px; }<br \/>\n\tdt { float: left; font-weight: bold; padding: 5px 10px 5px 0; width: 100px; }<br \/>\n\tdd { padding: 5px 0; }<br \/>\n\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#39;s not news to any web developer that table-based layouts are way out of style. Tables were originally intended for tabular data, or data in&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[14],"tags":[147],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/462"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":464,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions\/464"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}