Populating a table after creation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
korngold
Forum Newbie
Posts: 11
Joined: Wed Nov 02, 2005 11:49 am

Populating a table after creation

Post by korngold »

Hi all,

Is this possible? I have a client who is requesting the strangest format I've ever seen and won't take no for an answer. The only thing I can figure out is to create the table first (like a template) and then populate the data aftwards. Is there a way to assign an ID or variable to each cell that needs to be populated?

Thanks in advance!
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Yes, with javascript, but why not do it as it is created?
korngold
Forum Newbie
Posts: 11
Joined: Wed Nov 02, 2005 11:49 am

Post by korngold »

I have tried to figure out a way to do the data and the table simultaneously, but there's no way I can think of to do so. The table is an oddly-formatted calendar that is actually created using PHP, and it needs to go through at least 2010.

Here's what the calendar looks like:
Funky Calendar

So, I'm basically using the "cal_to_jd" function, incrementing by 1, creating a row, then when the month turns it adds another column and repeats. Plus, they have to have each weekday line up on the left. Can you tell this report was originally a spreadsheet?!?!

My only thought was to assign each "DATA" point with an ID based on the Julian Day Count, then load the data in. I need to enter info based on each specific date, so I was going to convert my data tables' "date" field to the Julian Day Count and try to match it up with the respective cell, but I can't figure out how to do it.
korngold
Forum Newbie
Posts: 11
Joined: Wed Nov 02, 2005 11:49 am

Post by korngold »

Grim... wrote:Yes, with javascript, but why not do it as it is created?
How would I go about doing this using Javascript? Any option sounds good right now, since the customer needs this yesterday. 8O

Thanks!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

You have to name the table elements and access them like you would a form.

I think it's something like this...

document.tablename.dataname.value...
here is where you would find out how to do so...
http://www.w3schools.com/htmldom/dom_obj_tabledata.asp
Post Reply