File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes expand table row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "expand table row" Watch "expand table row" New topic

expand table row

FY Hsieh
Ranch Hand

Joined: Aug 07, 2006
Posts: 73
Need to display data in a JSP html table with many rows. For some rows, I want to add an expandable icon so when I click the icon that row can expand into some sub-rows and each sub row has its own data, but sub rows have the same column name as other rows.

Can javascript help me get this feature in a HTML table ?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63551

Yes. Once you learn how to use JavaScript to manipulate the DOM, possibilities are endless.

[Asking smart questions] [About Bear] [Books by Bear]
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 991

you might want to look at the display attribute in css,

you could use javascript to track the changes to the expandable icon and change a set of subrow's display to
"inherit" or "none"

just an idea....

My Website: [] Cool your mind:[] My Sally:[]
I agree. Here's the link:
subject: expand table row
It's not a secret anymore!