/    Sign up×
Community /Pin to ProfileBookmark

Tables, Scripting, and color changing… possible?

To anyone who reads/helps, thank you in advance…

I was wondering if it were possible to change the color of a table row based on the how long the table row has existed?

Info… (Useless or useful…) I have a SharePoint server and it is setup at my work to allow co-workers to submit “forms” for information updates, etc. However these forms are not always checked in a timely manner. I was wondering if possible to change the bgcolor from the theme color to a color of my choice if the entry is there for more than say… an hour?

Am I even making sense? Haha. Hope so. Again, thanks in advance for reading & helping.

to post a comment
Full-stack Developer

6 Comments(s)

Copy linkTweet thisAlerts:
@loftieauthorMar 08.2009 — Also:

I was looking into possibly using VBScript for this. We only use IE6.0 and do not have to worry about cross-browser functionality.
Copy linkTweet thisAlerts:
@FangMar 08.2009 — Is there a date in the table row?
Copy linkTweet thisAlerts:
@loftieauthorMar 08.2009 — Is there a date in the table row?[/QUOTE]

Date and timestamp. I was thinking of playing with 'if' and 'then' vbscripting... but my knowledge of vbscript is poor.
Copy linkTweet thisAlerts:
@FangMar 08.2009 — Example table?
Copy linkTweet thisAlerts:
@loftieauthorMar 08.2009 — Sloppy... hope it makes sense. Added 'NULL' where the original link was for obvious reasons.

Also, would just like to mention that the information is pulled/saved to InfoPath from the SharePoint...

[CODE]<TD Class="ms-vb2">Not started</TD><TD Class="ms-vb2"><A onfocus="OnLink(this)" HREF="http://NULL/FollowUp%20Request/Updated_Info.xml" onclick="DispDocItemEx(this,'FALSE','FALSE','FALSE','')">Updated_Info</A><IMG SRC="/_layouts/1033/images/new.gif" alt="New"></TD><TD Class="ms-vb2">3/8/2009 16:22</TD><TD Class="ms-vb2">Information Update</TD></TR></TABLE></td></tr></table> <table width=100% cellpadding=0 cellspacing=0 border=0 > <tr> <td colspan="2" class="ms-partline"><IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt=""></td> </tr> <tr> <td class="ms-addnew" style="padding-bottom: 3px"> <img src="/_layouts/images/rect.gif" alt="">&nbsp;<a class="ms-addnew" ID="idAddNewForm" href="http://NULL/FollowUp%20Request/Forms/Upload.aspx?RootFolder=" ONCLICK="javascript:NewItem('http://northernsp/ctwest/Care_Comm/FollowUp%20Request/Forms/Upload.aspx?RootFolder=', true);javascript:return false;" target="_self">Add new form</a> </td> </tr> <tr><td><IMG SRC="/_layouts/images/blank.gif" width=1 height=5 alt=""></td></tr> </table></div></td></tr></table>[/CODE]
Copy linkTweet thisAlerts:
@CharlesMar 08.2009 — &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Example&lt;/title&gt;
&lt;style type="text/css"&gt;
tr.old-entry {background-color:#a00; color:#fff}
&lt;/style&gt;

<i> </i> &lt;script type="text/javascript"&gt;
<i> </i> Date.ONE_HOUR = 1000*60*60;

<i> </i> function update() {
<i> </i> var now = new Date(), i = 0, tr;
<i> </i> tbody = document.getElementsByTagName ('TBODY')[0];
<i> </i> while (tr = tbody.getElementsByTagName ('TR')[i++])
<i> </i> tr.className = now - new Date (tr.firstChild.firstChild.data) &gt; Date.ONE_HOUR ? 'old-entry' : ''
<i> </i> }

<i> </i> if (document.getElementsByTagName) onload = function () {
<i> </i> update();
<i> </i> // setInterval ('update()', 100);
<i> </i> }
<i> </i> &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Datetime&lt;/th&gt;&lt;th&gt;Giant Said&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;8 March 2009 2:00 pm&lt;/td&gt;&lt;td&gt;Fee&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8 March 2009 3:00 pm&lt;/td&gt;&lt;td&gt;Fie&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8 March 2009 4:00 pm&lt;/td&gt;&lt;td&gt;Foe&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8 March 2009 5:00 pm&lt;/td&gt;&lt;td&gt;Fum&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
×

Success!

Help @loftie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...