Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table or list: what should I use here?

I would like to know which tags I should use for layout like this. Semantically is both a table and a list to me. How I can achieve those underlines and keep the markup right?

enter image description here

like image 729
Somal Somalski Avatar asked May 16 '12 14:05

Somal Somalski


2 Answers

I would personally use an ordered list to achieve this, the sub list under Suma skladki means it isn't really tabular data.

This link should give you EXACTLY what you need:

http://thepcspy.com/read/css_table_of_contents/

like image 82
Richard Askew Avatar answered Sep 23 '22 13:09

Richard Askew


To me personally, this looks more like a list than a table (though you could still construct it as a table, and do so justifiably). I would construct it as a nested list.

<ul>
  <li>Suma skladki <span class="price">900 PLN</span>
    <ul>
      <li>Skladka podstawawa 
          <span class="desc">(dia przychodu 250 000 PLN)</span> 
          <span class="price">550 PNL</span>
      </li>
    </ul>
  </li>
</ul>

This will also give you more design flexibility in the future than if you use a table element. I'm not so sure a table communicates the nested hierarchy that you have here as well as a series of lists either.

like image 41
Sampson Avatar answered Sep 24 '22 13:09

Sampson