0

I am trying to create a html list which is sortable via Jquery. Now i want to have multiple columns in my li element. An example would be this: Flexigrid

As you can see the li element is divided into "ISO", "Name", "Printable name" and "Number-Code". I know that in the case of Flexigrid this is accomplished with Jquery. But I would like to know whether there is a css/html way to create multiple columns like that. It would be kind of easy if it was possible to create divs inside the li element eachone floating. But since that´s not valid I dont know a solution.

PS: if someone knows a simple Jquery solution that would also help.

Thanks for your help! phpheini

6
  • It sounds like you are trying to display your data in rows and columns, almost like a table? So why not use a <table>? Commented Nov 19, 2011 at 16:54
  • Well first I thought using tables is not really good in modern times of html since they are slower. Secondly how would I be able to sort the rows in a table with jquery? Commented Nov 19, 2011 at 16:55
  • 2
    I am not sure what time you are referring to that would be 'slower', but I assure you the difference, if any, is minimal for the use case you are talking about. Semantically, if you have tabular data to display you should be using a table. Tables are only frowned upon when used for layout of non-tabular data. In terms of how you would sort it, you only have to google 'jquery sort table' and plenty of options come up. Commented Nov 19, 2011 at 17:05
  • ok, I thought tables nowadays are generally considered as "bad" html! So I will use tables then. Thank you! Commented Nov 19, 2011 at 17:31
  • Tables are bad when used to compose layouts for entire pages. If it is tabular data, a table is absolutely the right tool. Commented Mar 1, 2012 at 19:25

1 Answer 1

2

Tables are not bad to use in HTML, they're just bad to use for layout. If you are displaying tabular data (looks like you are), then tables are exactly the right choice to use. It's a matter of semantics, which in language can be pointless, but in HTML it's everything. Semantically-correct HTML is much easier for other tools to consume, such as web spiders, screen readers for the visually impaired, etc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.