473,385 Members | 1,720 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,385 software developers and data experts.

How can I "flip" content inside one td cell depending on a link in another td cell?

I have a website in which one page is to display a calender of events. Working with tables, I have one td-cell containing a-tag links (calendar style, 1st dec, 2nd dec etc) and a td-cell next to it should then show respective info for that date - how can I do that?
iframe looks really bad, frame doesn't work, any ideas? I'm happy to work with JavaScript or php...
THANKS for any help!
Nov 7 '12 #1
10 1810
Rabbit
12,516 Expert Mod 8TB
It would help to see your code along with a mockup of what you're trying to achieve.
Nov 7 '12 #2
Hmm. not much to show, as I can't figure out how to do it - Ideally I would like to have an include of a php-file pro date which should be visible in larger td-cell

Here code (which is just a simple table at the moment - content of div should ideally be clickable (anchor tag or similar, thought of building a nav menu, but problem is to figure out how to get the different links to be visual in td cell thereafter...):
Expand|Select|Wrap|Line Numbers
  1.      <td valign="top" align="left" width="30%" class="blurbtext" id="corners10" bgcolor="#FAFAFA">
  2.      <div class="blurbtext">Festival Schedule</div>
  3.      <div class="blurbtext"><a href="#01dec12.php"><b>1<sup>st</sup> December, 1pm to 5pm</b><br /> - Festival launch</a> </div>
  4. <div class="blurbtext"><a href="#01dec12.php"><b>4<sup>th</sup> December</b></a></div>
  5. <div class="blurbtext"><a href="#13dec12.php"><b>13<sup>th</sup> December</b></a> </div>
  6. </td>
  7. <td width="1%" bgcolor="transparent">&nbsp;</td>
  8. <!-- ABOUT TEXT begin -->    
  9.      <td valign="top" align="left" width="63%" colspan="3" class="blurbtext" id="corners11" bgcolor="#FAFAFA">
  10.         <a href="#about" id="about" />
  11. <!-- this is where I want content to change in relation to which date the user clicks on in previous td-cell -->
  12. <div class="title">1<sup>st</sup> December - Festival opening. Lights Switch On</div>
  13.         <frameset cols="100%"><frame src="01dec12.php" /></frameset>
  14. <!-- 01.dec12.php would look something like this:
  15. <div class="blurbtext">Festival launch with 2 Christmas markets, festive entertainment throughout the town, a funfair and the Lights Switch On at 4.30pm</div>
  16.         <div class="blurbtext">Meet our Festival-makers who'll greet you with festive cheer and help you find just what it is you're looking for!</div>
  17.         <div class="blurbtext">1pm onwards: </div> -->
  18.  </td>

does this help any further or you want an url? thanks for having a look!
Nov 7 '12 #3
Rabbit
12,516 Expert Mod 8TB
What about the mockup?

The only reason I'm asking for that is because I don't understand what you want to accomplish. And a picture of what you're looking for in the end product makes things much easier to understand.
Nov 7 '12 #4
I can understand that :-) Not very good at making explanations... here a screenshot...

Nov 7 '12 #5
Rabbit
12,516 Expert Mod 8TB
Which part of that image are you trying replicate in your code?
Nov 7 '12 #6
SO left td (first rounded td-cell) is the one with the dates, the right one is the description of what is going on on that particular date, so that right td-cell is the one where I want content to change depending on which date they click on in the date-td... does that make sense?

"Festival Schedule" should have linkable dates and

"1st December Festival opening blablabla ..."should be interchangeable according to which date someone clicks...
Nov 7 '12 #7
Rabbit
12,516 Expert Mod 8TB
How are you storing what happens on each date?
Nov 8 '12 #8
currently as php-files
Nov 8 '12 #9
Rabbit
12,516 Expert Mod 8TB
So a different php file for each date? Why not just link to the php file and have the same layout in each file?
Nov 9 '12 #10
Solved it in the end myself - and a simple solution.
What I wanted to do was dynamically change content of one td cell which was dependent of a link src in another td cell. So I used iframe in the second td-cell in the end and using a attribute target in order to dynamically change the content of the iframe. Simple, and hopefully I did it right - it looks good on my page though, so I suppose I did find the solution.

I did the following:

Code (much simplified):
Expand|Select|Wrap|Line Numbers
  1. <table>
  2. <tr>
  3. <td>
  4. <div class="textlink"><a href="01dec12.php" target="scheduleDetails"><b>1<sup>st</sup> December, 1pm to 5pm</b></a></div>
  5. <div class="textlink"><a href="10dec12.php" target="scheduleDetails"><b>10<sup>th</sup> December</b></a></div>
  6. <div class="textlink"><a href="16dec12.php" target="scheduleDetails"><b>16<sup>th</sup> December</b></a></div>
  7. </td>
  8. <!-- second td cell will dynamically change content dependent on which link is clicked above - that was all along what I was trying to achieve. With iframe and target it's simply done, just a bit too rusty with my knowledge, I suspect -->
  9. <td>
  10.  <iframe name="scheduleDetails" src="01dec12.php" scrolling="no" width="100%" height="400px" marginwidth="8px" frameborder="0"></iframe>
  11. </td>
  12. </tr>
  13. </table>
Nov 11 '12 #11

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

Similar topics

4
by: Rene Aube | last post by:
Hi everyone, I'm incharge of updating the stats on a chl hockey teams Web Site. I would like to know if there is a way (javascript) to be able to save the content of the CHL Statistics WebPage...
1
by: Tony A. | last post by:
Is it possible to programatically move focus from one cell to the next cell on the same row of a datagrid? Any suggestions will be greatly appreciated. -- Tony
2
by: dvomsaal | last post by:
I seem to remember there is a way to modify an element based on what it is next to, but I can't seem to locate it. Here's my scenario: We have some pages that are built dynamically and present...
5
by: Alex Maghen | last post by:
Hi. If I create a WebControl (User Control, actually), I know how, easily, to access the design-time Properties that have been set as Propertiy nodes in the tag used on the ASPX page. But I've...
1
by: sank06 | last post by:
Hi, I need to drag and drop the contents of a cell in to another cell. Thanks in advance. Sanks
1
by: srinivd1 | last post by:
Hi, I have a tabbed pane with 3 tabs.The content of each pane is going to be a different html based on from where the page is called. Now, i have defined the div tag for each of the panes as...
0
by: =?Utf-8?B?QnJpYW5ESA==?= | last post by:
Hi I am trying to find a way to change the background color of a cell (flash or blink) when its value has changed (by user or data update). I need to be able to do this for more than one cell...
2
by: abhilash12 | last post by:
pls help me when mouse move on the cell how can identify cell border using javascript
0
by: dan | last post by:
Hi, I have a GridView with five columns. One of the column renders its content either as a FileUpload or TextBox - depending on a value in another cell. I created an EditItemTemplate for the...
2
by: omar999 | last post by:
I can use the select sql max function with no problems; this is my code SELECT MAX(Bid_Amount) AS LargestBidAmount FROM Auction_1 then to output using asp Response.Write "<td...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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?
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
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,...

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.