| | |
Change left-border of a table cell with javascript
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2006
Posts: 11
Reputation:
Solved Threads: 0
Hi guys....
I am having trouble changing the color of the LEFT border in a table.
i'm using the following javascript:
cell1 is the correct id of the table cell.
If i take away the "-left" part in "border-left", it will change the border of the whole cell. Problem is, i need to change only SPECIFIC borders.
Any Suggestions?
Rock On
I am having trouble changing the color of the LEFT border in a table.
i'm using the following javascript:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.getElementById("cell1").style.border-left="3px red solid";
cell1 is the correct id of the table cell.
If i take away the "-left" part in "border-left", it will change the border of the whole cell. Problem is, i need to change only SPECIFIC borders.
Any Suggestions?
Rock On
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
Try "borderLeft" instead. One of the unfortunate aspects of web development is that the CSS property may or may not have a corresponding JavaScript property, and they don't always map directly to each other. Also, as you can see, the spelling will differ.
So, "style.borderLeft" is the JavaScript property that changes the "border-left" CSS declaration.
Here's a nice cross-reference: http://codepunk.hardwar.org.uk/css2js.htm
So, "style.borderLeft" is the JavaScript property that changes the "border-left" CSS declaration.
Here's a nice cross-reference: http://codepunk.hardwar.org.uk/css2js.htm
Last edited by tgreer; Aug 30th, 2006 at 4:19 pm.
![]() |
Similar Threads
- html table cell coloring (JSP)
- Gap between div and table (HTML and CSS)
- onClick Events to Change to dynamic text (HTML and CSS)
- Remove style with JavaScript (JavaScript / DHTML / AJAX)
- Frames of Pictures (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: how to change the the value of src in <embed> using javascript
- Next Thread: Disclaimer Messages
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array browser bug captchaformproblem cart checkbox child class close codes createrange() css cursor date debugger decimal dependent design disablefirebug dom dropdown editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming progressbar prototype redirect runtime safari scale scriptlets scroll search security shopping size software toggle unicode w3c web wysiwyg \n






