cancel
Showing results for 
Search instead for 
Did you mean: 

How to set border color individually ?

Former Member
0 Kudos

Dear Friends:

     Happy new year .

     I meet a technical problem in script , I would like to dynamically set border color in script .

     Ex.

     Top and bottom border set blue

     Left and right border set red

      I am aware of the property of "bordercolor" what can set border color , but it is for whole border in same color .

   

     Is there other object and property for border color individually setting in script? Please help .thanks a lot .

Accepted Solutions (1)

Accepted Solutions (1)

Florian
Active Contributor
0 Kudos

Hi Benjamin,

where is your problem.

You can choose the coler for all sides in one step, or set the style for every side.

Here is an example

document.getElementById("ex1").style.borderLeft="thick solid #0000FF";

--> How the Syntax work:

object.style.borderLeft="width style color"

So, just work trough the official documentation.

Regards

Florian

Former Member
0 Kudos

Hi Florian:

  Thanks a lot  for your reply . i tried it as your advice,but it doesn't work.

  I don't know if i did wrong ,actually i don't  see the object of "style" from script asistent window .

  Do you have any ideas? thanks a lot .

saudshaikh
Explorer
0 Kudos

Hi,

Rather than using borderColor, please try with border.edge.color.value. Following is an example in formcalc:

$.border.edge[0].color.value = "255,0,0"

$.border.edge[1].color.value = "0,255,255"

$.border.edge[2].color.value = "255,0,0"

$.border.edge[3].color.value = "0,255,255"

In above example 0 is the top edge followed by edge sequence in clockwise rotation. So your output will have top and bottom edges as red and right and left edges as blue.

Florian
Active Contributor
0 Kudos

Saud is right. I do not got a system yesterday and tested it today.

Here is the result:

And here come my formcalc - coding like described by saud:

Regards

Florian

Former Member
0 Kudos


Thank you all very much ...

saudshaikh
Explorer
0 Kudos

Hi,

I think would be more appropriate to close the thread by marking the correct answer which helped you.

Thanks.

Answers (0)