I'm working to redesign a legacy toolset and I'm looking at how to better display some information both presentationally and semantically.
The data hierarchically in nature but has properties that need to be readily visible to users. The desired layout is similar to below.
Seq Item Name Min Max - Anything under here isn't shown
1 Identifier 1 1 (Required)
2 Name 1 1
2.1 First Name 1 1
2.2 Middle Name - - (Optional but unlimted)
2.3 Last Name 1 1
3 Age - 1 (Optional)
At the moment this is one entire table, and the intdenting for the Sequence (Seq
) number is achieved by inserting additional table cells to kind of bump everything across to the right.
The challenge I have is figuring out how to effectively display this information.
First of all is this tabular data? I would say no, as the hierarchy is important, and the 'columns' are merely attributes of the item in each 'row'.
If it isn't tabular, what is it and how would that be done ? I would personally argue this is a set of nested UL
lists - the sequence number is optional and not always a number. If its a set of lists, that will indent sublists correctly, but what is the best way of presenting the short attributes?
If it is a table, what is the best way to present the semantic existance of the hierarchy in the table?
I think you should use a table. True, the hierarchy is more important, but it also can be displayed through manually writing down the first column. But the attributes min, max and item name could not be shown as easily in a list as in a table. My opinion: use a table and provide the seq column manually!
My suggestion would be to use nested ordered lists to retain your hierarchical structure, and then description lists to represent the "columns" for each row.
For example, the description list for the first row could look something like this:
You would have to use CSS to hide the description terms (since you don't want them showing up on every row) and to adjust the layout to look more like a table.
The downside to this format is that you are going to be duplicating the column headings on every single row. But semantically I think that makes the most sense, and it should also make the content more meaningful to a screen reader.
I've made a first attempt at the CSS for this so you can get an idea of how it could work. This is probably not very well done, but at least it'll give you something to start with.
CodePen Link
UPDATE: I've added the use of IDs and "headers" attribute to, somehow, semantically mark up the hierarchy.
That's definitively tabular data (you should really push the definition of "list" to justify using an UL or DL here!).
I think a good approach would be using different tbodys to group those related rows together (something like this it used here http://www.w3.org/TR/2012/WD-html5-20120329/the-table-element.html#the-table-element see "table being used to mark up a Sudoku puzzle")
Then you could use something like this:
If fact, I think you can only use tbody to group rows together and leave single rows alone
Why not both? A tree grid is a good way to represent tabular data that also conforms to a hierarchy.
This is one such example.
However, having used Extjs on two very large projects, my own personal recommendation is to stay away from it if you're going to be producing a large application. While it may be fine for a one-off grid, I personally find that it's poorly implemented and can become more cumbersome as the size of the project increases. However, it is very feature rich, so the examples panel may give you some more ideas on grids (tables) that might help you.
Keep in mind that you should always be asking yourself, "what questions are my users trying to answer?" Then, ask yourself, "which graphical devices give the clearest and simplest path to answering that question?"
One book that really helped me with these questions was the dashboard design book. Even though you may not be building a dashboard, it has many UX techniques and theories that have made it easier for me when selecting the appropriate UI element (with respect to data).
Hope that helps...
I would present it by using a table and by adding custom data attributes to the
td
tags:Then, with the help of jQuery, set the padding of each cell value in your table:
See it working on jsFiddle.
I think there are two sensible ways how to represent this in HTML:
table
and make the relation/hierarchy explicit with natural languagetable
with a column explaining the hierarchyIf there is no markup for defining this relationship, you should use text. If the visual representation is unambiguous, you could visually hide this text so that it is only accessible for screenreader/text browser users.
In your case, you could add a column that explains the relationship of rows that are "sub items":
Each row could get an
id
(with value of Seq or Item Name), so that this row can be linked {note thatid
values starting with a digit are not allowed in HTML 4.01; you could use something likeid="seq-2.1"
there}. If an item is a child of another item, you could link to the row of the parent item.This way you make it clear for humans, and machines still see that these rows are connected, although the specific semantics of this relation is not machine-readable. You could use a link type (
rel
value) here if to make the meaning of the relation explicitly clear. In HTML 4.01 you could create a value yourself, in HTML5 it would need to be registered first.sectioning elements / headings
Instead of using a
table
, you could make use of HTML’s outlining. {The following example uses HTML5’s sectioning elements. If you use HTML 4.01, simply replace the sectioning elements withdiv
(or no element at all) and use headings only.}Each section (introduced by a heading) represents an item. The outline of the headings (resp. nesting of the sectioning elements) represents the hierarchy of your items.
Here is an example to see the whole structure:
Each
section
could contain adl
for the properties:Depending of the actual meaning of your content, you could use the
code
element for the item names (e.g. if it describes elements of a markup language, for example), and/or thedfn
element, if the following content is a definition of that item.