473,403 Members | 2,270 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,403 software developers and data experts.

div question

Hi,

Is there a way to define the content of a div or a span in one place, but
then place it in the document in another place? I do not want to do absolute
position. I will probably want to include that span in a table cell. The
reason I want to do this is to make the table code nice and compact and to
be able to see the table structure even if the div has long content.

Many thank in advance,

Aaron Fude
Jul 20 '05 #1
6 2251
rf

"Aaron Fude" <aa*******@yahoo.com> wrote in message
news:cc***********@news.wplus.net...
Hi,

Is there a way to define the content of a div or a span in one place, but
then place it in the document in another place? I do not want to do absolute position. I will probably want to include that span in a table cell. The
reason I want to do this is to make the table code nice and compact and to
be able to see the table structure even if the div has long content.


No.

Well... yes if you code your server side process correctly.

But why bother, why should a table cell contain so much anyway, that is if
it *is* tabular data?

--
Cheers
Richard.
Jul 20 '05 #2
in post: <news:cc***********@news.wplus.net>
Aaron Fude <aa*******@yahoo.com> said:
Is there a way to define the content of a div or a span in one place, but
then place it in the document in another place?
http://allmyfaqs.com/faq.pl?Include_one_file_in_another
The reason I want to do this is to make the table code nice and
compact and to be able to see the table structure even if the div has
long content.


thats fine using the server side options at the link above before the
server does its majic but the end result spat out at the browser end
will have the <td> containing goodies.

and just in case you're using <table>s for layouts. <smack on wrist/>
stop it. use css.
--
b r u c i e
Jul 20 '05 #3

"brucie" <sh**@usenetshit.info> wrote in message
news:1k****************@usenetshit.info...
in post: <news:cc***********@news.wplus.net>
Aaron Fude <aa*******@yahoo.com> said:
Is there a way to define the content of a div or a span in one place, but then place it in the document in another place?
http://allmyfaqs.com/faq.pl?Include_one_file_in_another
The reason I want to do this is to make the table code nice and
compact and to be able to see the table structure even if the div has
long content.


thats fine using the server side options at the link above before the
server does its majic but the end result spat out at the browser end
will have the <td> containing goodies.

and just in case you're using <table>s for layouts. <smack on wrist/>
stop it. use css.


ok, ok - I'll reveal what I'm really trying to do. I have a page with a lot
of content. It is tablular data and the able has 1000 lines. I was planning
to break it up into 20 tables with 50 rows each. I will then use COOLjsTree
(http://javascript.cooldev.com) to hide all but one table. The darn thing
is, COOLjsTree requires its HTML content to be a valid javascript string
which is cubersome for a table with 50 lines. So I thought I would put that
table in a div and just mention the dive in the javascript string.

Here's an example for COOLjsTree developers (which I think is ugly):

var t1 = '<table bgcolor="#4682B4" width="400" cellspacing="0"
cellpadding="0" border="0"><tr><td align=center><font
color=white><b>Personal Info</b></font></td><tr></table>';
var f1 = '</a><table width="400" cellspacing="0" cellpadding="0"
border="0"><tr><td bgcolor="#EEEEEE">';
f1 += '<table width="100%" cellspacing="2" cellpadding="2" border="0">';
f1 += '<form action="javascript:alert(\'Submitted\');" method="get">';
f1 += '<tr><td><p class="last">First Name</td><td><input
type="text"></td></tr>';
f1 += '<tr><td><p class="last">Last Name</td><td><input
type="text"></td></tr>';
f1 += '<tr><td><p class="last">Age</td><td><select><option>from 10 to
15<option>from 16 to 20<option>from 21 to 30<option>from 31 to
40<option>older 40</select><td></tr>';
f1 += '<tr><td colspan=2 align=center><input type="submit"
value="Submit">&nbsp;<input type="reset" value="Reset"></td></tr>';
f1 += '</form>';
f1 += '</table></td></tr></table>';

.... lator on f1 is used:

var FORM_NODES = [
[t1, null, null,
[f1, null, null],
],
SO, I'm looking to avoid creating a long javascript string wih HTML content.

--
b r u c i e

Jul 20 '05 #4
Aaron Fude wrote:
ok, ok - I'll reveal what I'm really trying to do. I have a page with a lot
of content. It is tablular data and the able has 1000 lines. I was planning
to break it up into 20 tables with 50 rows each. I will then use COOLjsTree
(http://javascript.cooldev.com) to hide all but one table. The darn thing
is, COOLjsTree requires its HTML content to be a valid javascript string
which is cubersome for a table with 50 lines. So I thought I would put that
table in a div and just mention the dive in the javascript string.


Yuk. Use PHP and put the table content into a database. Then you can
dynamically generate separate pages for each of the 20 sub-tables.

PHP and MySQL rules, and takes way less time to learn than you might
think. My site is entirely generated thusly, and performance is
excellent, even on the old P100 that's serving it.

--
Mark.
http://tranchant.plus.com/
Jul 20 '05 #5
Aaron Fude wrote:
I will then use COOLjsTree (http://javascript.cooldev.com) to hide all
but one table. The darn thing is, COOLjsTree requires its HTML content
to be a valid javascript string which is cubersome for a table with 50
lines. So I thought I would put that table in a div and just mention the
dive in the javascript string.


Hmm, that's a damned ugly way of doing it. A better idea, that will still
work when JavaScript is disabled, would be to give each table an id (eg.
table1, table2, table3 etc) and then have a script that is called through
the onload() event in the body element.

The script would then loop through each of the table ids and set the
display property for that element to "none", obviously leaving one of the
tables displayed.

Then it's just a matter of creating a link for each table that when
clicked does the opposite of the onload() script. These links can also be
written out with JavaScript so that script-disabled browsers don't see
them.

See http://www.webpageworkshop.co.uk/main/article11 for an example of how
this can be done with lists. Adapting it to table shouldn't be too hard a
task.

--
Dylan Parry
http://www.webpageworkshop.co.uk - FREE Web tutorials and references
Jul 20 '05 #6
In article <cc***********@news.wplus.net>, aa*******@yahoo.com
says...
ok, ok - I'll reveal what I'm really trying to do....
Oh you are headed in the right direction...
I have a page with a lot...

<snip>

Is putting each set of 50 on a different page not an option? With a
link to all 20 pages included somewhere on each page so you can jump
around. That would probably work on all browsers. If you want
javascript, then google "collapsible div DHTML" and you will be
rewarded with a ton of examples.
--
WebcastMaker
The easiest and most affordable way to create
Web casts, or put presentations on the Web.
www.webentations.com
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.