Jonathan
Jonathan

Reputation: 2358

Displaying Large Amounts of Data in an HTML Table

I am generating HTML tables based on SQL statements for a Datawarehouse created through meta table information.

One of the issues I have is some of returned Datatables have 100 plus columns. Is there a neat way of displaying this in an HTML table or a specific design solution. Please note I am looking at the display here. Changing the amount of columns available is not an option. All columns need to be rendered.

Many thanks in advance for input.

Upvotes: 1

Views: 4878

Answers (2)

Registered User
Registered User

Reputation: 3699

What you are describing is called datagrid. You definitely should not generate the HTML yourself(as you sad) and instead just bind the result set to any kind of server-side data-grid or use some kind of client-side jQuery datagrid implementation.

https://stackoverflow.com/questions/159025/jquery-grid-recommendations

Upvotes: 1

Madara's Ghost
Madara's Ghost

Reputation: 174977

I can think of 2 good solutions:

  1. Wrap the whole table with a fixed-width container, and set overflow-x: auto on it. That will cause the table to scroll.
  2. Allow the user to filter out whichever columns he doesn't need to see using JavaScript/jQuery.

Both are possible, the first is obviously easier to implement, but with the second you have more control. Choose your path and if you're stuck, you can ask here on StackOverflow for help.

Upvotes: 4

Related Questions