473,385 Members | 1,693 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 do I address the text in a cell?

110 100+
I have a table named 'tableCompletionFeedback' with a cell named 'percent'. In the cell I have placed text ('10% complete") and I want to be able to change the text with javascript. My problem is I don't know how to address the text in that cell. This, for example, doesn't work:

document.getElementById('percent').text="20% complete";

Can anyone tell me how to make the text change with javascript?
Dec 18 '08 #1
3 1351
iam_clint
1,208 Expert 1GB
Heres how you would do it.

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('percent').innerHTML="20% complete";
<table><tr><td id="percent"></td></tr></table>
Dec 18 '08 #2
andersond
110 100+
That worked like a charm. The only problem that remains is that it wants to put the text in 12 pt. Courier ranter than 10 pt. Arial Narrow.

This doesn't work. What should I have done?
<code>
document.getElementById('percent').innerHTML.face= "Arial Narrow";
document.getElementById('percent').innerHTML.size= "2";
</code>
Dec 18 '08 #3
Dormilich
8,658 Expert Mod 8TB
@andersond
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('percent').style.fontFamily="Arial Narrow";
  2. document.getElementById('percent').style.fontSize="12pt";
regards

PS or did you want 10pt Courier? well, syntax is the same anyway.
Dec 18 '08 #4

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

Similar topics

1
by: johkar | last post by:
I have a grid. When the focus is put on a cell an input is created with the value being the cell's text. I would like to size the input to the physical width of the text. Ideas? John ...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
3
by: Bill M. | last post by:
Hello, What's up with this? I've got a <td id="container"> and want to set the text in this cell like .... var container = document.getElementById('container'); container.data = "Data in...
2
by: Chris Coho | last post by:
Is there any way to get the same affect as alt text for an image on a table cell? For instance I want if someone rolls the mouse over the cell for some instructions to pop up like they do for...
1
by: john | last post by:
I want to set the cell width and height such that the cell doesn't get bigger. If the text is too long for the cell, it should be clipped. It only has to work for IE. I have tried setting the...
1
by: meworkingman | last post by:
I'm a relative CSS newbie and I'm trying to do the following: I have a table that holds text that might span multiple cells. I want it to look something like this: ...
7
by: doreply | last post by:
I've got code: struct Cell{ list<int> vertices; bool discrete; Cell* nextCell; } struct SearchNode{ Cell* partition;
1
by: DaveyP | last post by:
I have a user control (called data_dictionary) which I need to add into the header text of a datagrid. I'm doing this by adding the control in the RowCreated event as follows: dds_descriptions...
1
by: swetha123 | last post by:
hello , I need to alert the value entered in the text box,which is in TD cell, using DOM can any one tell how please here is the code with out a text box which is working <html> <head> ...
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: 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: 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
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
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,...

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.