473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

expand table rows

Hi

Does anyone have a simple way to expand and collapse table rows. For example i will have 26 rows (one for each letter of alphabet) then i can say expand A and i will get a list of things there?

thanks
Feb 18 '08 #1
6 7034
nomad
664 Expert 512MB
Hi

Does anyone have a simple way to expand and collapse table rows. For example i will have 26 rows (one for each letter of alphabet) then i can say expand A and i will get a list of things there?

thanks
Do you mean you need help with pull down menus?

nomad
Feb 19 '08 #2
no like a expanding menu

>A
--------->apple
>B


etc etc

but where apple is i want to be able to have like a couple of paragraphs
Feb 19 '08 #3
Here is how to do it.
Good Luck,
Feb 19 '08 #4
Thanks thats exactly what i want to try and do but i seem to be having problems. I cant get more that the 2 thats are present there, would it be possible for you to edit and for 26 and i can work from there?

thanks
Feb 19 '08 #5
Thanks thats exactly what i want to try and do but i seem to be having problems. I cant get more that the 2 thats are present there, would it be possible for you to edit and for 26 and i can work from there?
thanks
Simply, add divs as u need. "Note that the posted link deals with divs ( not tables ) ".
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> stu nicholls dot com | Show me some more</title>
<style type="text/css">
/* always visible */
#outer .holder {padding:1em; border:1px solid #ddd; margin:0 20px 10px 0;}
#outer .holder p {padding:5px 0 0 0; margin:0;}
#outer .holder p.bold {font-weight:bold;}
#outer .holder h2 {margin:0; padding:0;}

/* unclicked style div.more */
#outer div.more i {float:right; margin-right:-10px 10px 0 0; cursor:pointer; color:#c00; font-weight:bold;}
#outer div.more i.hide {display:none;}
#outer div.more p {display:none;}
#outer div.more img {display:none;}

/* clicked style div.click */
#outer div.click i.show {display:none;}
#outer div.click i.hide {display:block;}
#outer div.click p {display:block;}
#outer div.click img {display:block; float:left; padding-right:10px;}

</style>

<script language="javascript" type="text/javascript">
clickMenu = function(menu,element,cname) {
var getEls = document.getElementById(menu).getElementsByTagName (element);

for (var i=0; i<getEls.length; i++) {
getEls[i].onclick=function() {
if ((this.className.indexOf(cname))!=-1)
{
if ((this.className.indexOf('click'))!=-1) {
this.className=this.className.replace("click", "");;
}
else {
this.className+=" click";
}
}
}
}
}
</script>

</head>

<body onload="clickMenu('outer','div','more')">

<div id="outer">

<div class="holder">
<p>A</p>
<div class="more">
<i class="show">more »</i>
<i class="hide">« less</i>

<br />
<p>apple</p>

</div> <!-- end of more -->
</div> <!-- end of holder -->

<div class="holder">
<p>B</p>
<div class="more">
<i class="show">more »</i>
<i class="hide">« less</i>
<br />
<p>Ball</p>

</div> <!-- end of more -->
</div> <!-- end of holder -->

<div class="holder">
<p>C</p>
<div class="more">
<i class="show">more »</i>
<i class="hide">« less</i>
<br />
<p>Candy</p>

</div> <!-- end of more -->
</div> <!-- end of holder -->

</div> <!-- end of outer -->
<p>&copy; 2007 stunicholls.com</p>

</body>
</html>[/HTML]
If you gonna use div for each alphabet, u will end up with 26 divs at least each page, which isn't a solution !!!
If u want to use tables, here is a table example.
Feb 20 '08 #6
If you are still facing problems, I recommend that u ask on javascript board cuz this questions is a JS one and experts there can help u.
Feb 20 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Rick DeBay | last post by:
I'm trying to create a layout table, where the spacing between rows varies. I've tried using setting margin-top and border-top for the rows I wan't spaced down from the one above, and I've also...
5
by: Harry Gould | last post by:
To all, I'm a newbie here, so please bear with me. I develop web pages for a company intranet where Internet Explorer 6 is the standard. Now I must develop a public internet website that is...
3
by: AR | last post by:
Hi, How can I hide table rows? ... tried with the following example: FireFox works... How to do the simillar in IE6? <html> <head> <script language="javascript"> function hide_row() { var v...
3
by: Bijoy Naick | last post by:
I have something strange going on.. My .aspx page contains a file upload control, a "Import Data" button, a "newTransactions" <asp:table>, a"SaveTrans" button and an confMsg label. First the...
1
by: jbreaker | last post by:
Hi - I have a table with about 30 rows, which contain a checkbox and a bit of text each. What I'm trying to find a way to do is to have 2 buttons at the bottom of the page - HIDE & SHOW. When the...
1
by: somaskarthic | last post by:
Hi In my application , i need to create table rows at runtime. Using javascript with table id arguments i could replicate the rows at runtime. Each of these rows has checkboxes (7.no) , dropdown...
7
by: leiño | last post by:
Hi, i am adding table rows dynamically with javascript. This works fine. The table is inside a div with scrolls, initially with 6 rows: ..... <div style='overflow:auto; width:100%;...
2
by: kalyanilovesme | last post by:
Hi I have a html table.. and i am adding the table rows dynamically... actually table rows are 64.. but according to the program some are visible and other are invisible.. i want to calculate...
1
gskoli
by: gskoli | last post by:
Dear all Below i have given example of my HTML table structure Where two different <Td> are containing separate table both having same no. of rows but second table having some rows where...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.