/    Sign up×
Community /Pin to ProfileBookmark

Collapsible rows.

a;kdjfa;sdf;asdfakdsf;kajsdf;kajsdfkja;dsjfa;skfd;aksdf;asdf;asjfd;aksdf

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 29.2005 — [code=html]
<p>
<button type="button" onclick="
var x, opt, txt, tbl = document.getElementById('myTable');
if (tbl.rows[2].style && tbl.rows[2].style.display == 'none') {
opt = 'block';
txt = 'Hide Rows 3 thru 5';
} else {
opt = 'none';
txt = 'Show Rows 3 thru 5';
}
for (x=2; x<5; x++) {
tbl.rows[x].style.display = opt;
}
this.value = txt;
return true;">Hide Rows 3 thru 5</button>
</p>

<table id="myTable">
<tr>
<td>row1,col1</td>
<td>row1,col2</td>
</tr>
<tr>
<td>row2,col1</td>
<td>row2,col2</td>
</tr>
<tr>
<td>row3,col1</td>
<td>row3,col2</td>
</tr>
<tr>
<td>row4,col1</td>
<td>row4,col2</td>
</tr>
<tr>
<td>row5,col1</td>
<td>row5,col2</td>
</tr>
<tr>
<td>row6,col1</td>
<td>row6,col2</td>
</tr>
</table>
[/code]

EDIT: By the way... I forgot to mention that I can't speak to the XML/XSL thing. Hence, I posted just standard HTML/JavaScript stuff and leave the rest up to you. Cheers. ?
Copy linkTweet thisAlerts:
@VladdyMay 29.2005 — Seems like table is a wrong mark-up choice to base such functionality on
Copy linkTweet thisAlerts:
@gnorkinauthorMay 29.2005 — asdfasdfasdf
Copy linkTweet thisAlerts:
@gnorkinauthorMay 29.2005 — asdfasdfasdf
Copy linkTweet thisAlerts:
@phpnoviceMay 29.2005 — Cheers.
×

Success!

Help @gnorkin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...