# CSS border styles do not work

**URL:** <https://forum.servoy.com/t/css-border-styles-do-not-work/18420>\
**Category:** Classic Servoy\
**Created:** [March 31, 2015, 2:18pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420 "2015-03-31T14:18:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [March 31, 2015, 2:18pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/1 "2015-03-31T14:18:23Z")

</div>

I have a html area to show the timetable. In the I use a definition. Using for example:

- border: 1px solid red;  
 → does not work

- border-width: 1px 1px 1px 4px;

- border-color: red, green, blue, yellow;  
 → creates a 2px black border around the cell

- border-top-width: 2px;

- border-top-color: red;  
 → see attached screenshot (behaves very strange)

adding border-right-width, border-right-color, border-bottom-width etc. creates the same rendering as above, regardless of the defined color(s)

To my experience the border tags don’t work at all or not as expected (in this setting). Can someone confirm this behavior?

Regards,

 ![timetable.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/1/18379d34bf0ee4b751ba2452e81ad425562e4a49.png)

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 31, 2015, 2:27pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/2 "2015-03-31T14:27:38Z")

</div>

Maybe it’s easier to use a Java FX panel for this (see [https://github.com/Servoy/svyJFXWebView](https://github.com/Servoy/svyJFXWebView))? Then you can do almost anything. I also had a lot of issues like that the other day with the normal Java html renderer…

---

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [March 31, 2015, 2:43pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/3 "2015-03-31T14:43:29Z")

</div>

Thanks for the hint Patrick. But as these are CSS styles supported according to the documentation in Servoy 7 → [https://wiki.servoy.com/display/Serv7/S … properties](https://wiki.servoy.com/display/Serv7/Supported+CSS+style+properties), I still would expect them to work. Otherwise it make no sense to define them as “supported styles”.

> patrick:  
> Maybe it’s easier to use a Java FX panel for this (see [https://github.com/Servoy/svyJFXWebView](https://github.com/Servoy/svyJFXWebView))? Then you can do almost anything. I also had a lot of issues like that the other day with the normal Java html renderer…

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 31, 2015, 2:47pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/4 "2015-03-31T14:47:41Z")

</div>

The CSS classes mentioned apply to Servoy elements, not stuff you do in a HTML area. The border you complain about is not rendered by Servoy, it is rendered by the Java renderer of the HTML area component (and that is terrible). The only border Servoy controls in your setup is the one around the whole calendar (HTML area).

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 31, 2015, 2:48pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/5 "2015-03-31T14:48:31Z")

</div>

And I think as soon as you use inline styles, your borders will be fine even with that renderer…

---

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [March 31, 2015, 3:14pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/6 "2015-03-31T15:14:15Z")

</div>

Thanks for the explanation, Patrick.

> patrick:  
> The CSS classes mentioned apply to Servoy elements, not stuff you do in a HTML area. The border you complain about is not rendered by Servoy, it is rendered by the Java renderer of the HTML area component (and that is terrible). The only border Servoy controls in your setup is the one around the whole calendar (HTML area).

---

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [March 31, 2015, 3:16pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/7 "2015-03-31T15:16:45Z")

</div>

This inline code does not work:

````auto
timetableForClass += '<td style = "border-left-width: 2px; border-left-color: #ff0000; border-left-style: solid; background-color: #b5d5ff;">' + lessonInfo*[j] + '</td>';*
*```*
*This does work:*
*```*
_timetableForClass += '<td style = "border-width: 2px 2px 2px 2px; border-color: #ff0000; border-style: solid; background-color: #b5d5ff;">' + lessonInfo*[j] + '</td>';*_
_*```*_
_*This does not work (only border-width changed):*_
_*```*_
<em>_timetableForClass += '<td style = "border-width: 0px 0px 0px 2px; border-color: #ff0000; border-style: solid; background-color: #b5d5ff;">' + lessonInfo*[j] + '</td>';*_</em>
<em>_*```*_</em>
<em>_*> patrick:*_</em>
<em>_*> And I think as soon as you use inline styles, your borders will be fine even with that renderer...*_</em>
````

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 31, 2015, 3:38pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/8 "2015-03-31T15:38:10Z")

</div>

So now you can either fiddle around until you find old school html that the renderer can handle or use the FX bean to show any html you want.

---

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [March 31, 2015, 4:06pm UTC](https://forum.servoy.com/t/css-border-styles-do-not-work/18420/9 "2015-03-31T16:06:59Z")

</div>

How will “old school” HTML be affected with the arrival of the NGClient? Will it have the same issues or will it differently, better support CSS and HTML?

> patrick:  
> So now you can either fiddle around until you find old school html that the renderer can handle or use the FX bean to show any html you want.
