473,465 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Data tables without scripting?

20 New Member
I would like to greate groups of collapsible (and expandable) rows in a data table. I understand this should be achievable with tbody and visibility: collapse?

The bit of reading I've done so far seems to imply that these are basically unsupported in IE, and the little bit of experimentation I've done is having no effect in Firefox either.

Is there a CSS-only solution, involving no scripting, to create this effect? At the moment I'm aiming for compatibility with Firefox and IE 6+.

Just to clarify: I am not attempting to use tables in lieu of css. I am attempting to use css to format a data table.
Nov 22 '06 #1
5 1617
bradvanwick
13 New Member
I'm not aware of a solution with no scripting, but I do have a solution that uses CSS and minimal Javascript. If the user has Javascript disabled, then the information displays as if all were opened.
Let me know if you're interested.
Cheers.
Nov 23 '06 #2
nonsensitor
20 New Member
Sure...it can't hurt to take a look.
(well, ok, it could hurt a little bit)
Nov 23 '06 #3
bradvanwick
13 New Member
Ok. This is a quick version.

Let me know if this is what you had in mind.

This version does not pander to those with Javascript disabled. That's for next post (if this works for you).

Here is the HTML with all the CSS and Javascript inside of it:

[HTML]<html>
<head>

<meta name="save" content="history" />

<style type="text/css">
<!--
.save{
behavior:url(#default#savehistory);
}

.exp {
border: 1px solid #ccc;
}

p.exphead {
display: block;
width: %100;
}

a.dsphead {
display: block;
width: %100;
border-top: 1px solid #ccc;
background-color: #ccc;
}

a.dsphead:hover {
border-top: 1px solid #ccc;
}

a.dsphead span.dspchar {
font-size: 0.8em;
margin-left: 10px;
}

.dspcont {
display:none;
margin: 0 10px;
padding: 0 10px;
}
-->
</style>

<script type="text/javascript">
function dsp(loc){
if(document.getElementById){
var foc=loc.firstChild;
foc=loc.firstChild.innerHTML?
loc.firstChild:
loc.firstChild.nextSibling;
foc.innerHTML=foc.innerHTML=='Show Info'?'Hide Info':'Show Info';
foc=loc.parentNode.nextSibling.style?
loc.parentNode.nextSibling:
loc.parentNode.nextSibling.nextSibling;
foc.style.display=foc.style.display=='block'?'none ':'block';}}

if(!document.getElementById)
document.write('<style type="text/css"><!--\n'+
'.dspcont{display:block;}\n'+
'//--></style>');
</script>

</head>

<body>

<div class="save">
<div class="exp">
<p class="exphead">
<a href="javascript:void(0)" class="dsphead" onclick="dsp(this)">Heading <span class="dspchar">Show Info</span></a>
</p>
<div class="dspcont">
<p>Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.</p>
</div>
</div>

</body>
</html>[/HTML]
Nov 23 '06 #4
nonsensitor
20 New Member
Ok - at first glance I don't comprehend it - have not done any scripting as of yet. Will give my brain a bit of a rest and come back to it I think. Thanks.
Nov 23 '06 #5
bradvanwick
13 New Member
Hey,
I'm just checking up on you.
Were you able to apply this technique to your application?
Let me know if you have more questions.
Cheers.
Nov 28 '06 #6

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

Similar topics

4
by: Agoston Bejo | last post by:
I would like to use an ADODB.RecordSet object to temporarily store some data and then iterate through it. Actually it needs to be a RecordSet only because it is a perfect choice as data structure...
0
by: Saverio Tedeschi | last post by:
Ho all SQL gurus, I've searched for samples on how to automatically scripting SQL2000 tables to export data between databases via a sql script. (somehing like: INSERT INTO ..(, , , , , )...
4
by: Victor Engmark | last post by:
Background: People want to be able to record large amounts of product data ("a few MB") on laptop or tablet PCs without _any_ kind of network connection, and then to submit the data to a database...
32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
1
by: kjphipps_377 | last post by:
Hi all! I have an application that needs to copy the database structure from one database to another without using the "Generate SQL Script" function in Enterprise Manager. I'd like to do this...
22
by: googlegroups | last post by:
I am playing with the XMLHTTPRequest method to perform client/server transactions. I have it set up right now so that when readyState is 4, it takes the XML and processes it. This works great until...
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
2
by: xander.zone.3x | last post by:
How can we download data in tables in a html page into a csv file using client side Javascript. I should click a button and a table's data should be downloaded into a csv in local drive. The os...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.