# html table in action buttons

**URL:** <https://forum.servoy.com/t/html-table-in-action-buttons/6326>\
**Category:** Classic Servoy\
**Created:** [August 5, 2006, 4:30pm UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326 "2006-08-05T16:30:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [August 5, 2006, 4:30pm UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/1 "2006-08-05T16:30:12Z")

</div>

Hi there,

I am trying to use the following html on a button.

```auto
var html = "<html><table border=\"1\" width=\"100%\"><tr><td width=\"100%\">temp text asdas </td></tr></table></html>";

forms.test.elements.btn1.text = html;

```

But the html table never expands to 100% of the width of the button.  
Please help!!

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 6, 2006, 7:49am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/2 "2006-08-06T07:49:21Z")

</div>

Hi Hameed,

Just set the margin property of the label/button to 0,0,0,0 (top,left,bottom,right)

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [August 6, 2006, 8:06am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/3 "2006-08-06T08:06:53Z")

</div>

Hi Robert,

I have set the margins for the button as you stated. It did not solve my issue. The html table is not expanding to 100%

Please help!

Thanks!

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 6, 2006, 8:12am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/4 "2006-08-06T08:12:11Z")

</div>

I just put your HTML in a button and set the margin property to 0,0,0,0.  
Works fine here.

Servoy Developer  
Version R2 2.2.5-build 337  
Java version 1.4.2-54 (Mac OS X)

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [August 6, 2006, 9:31am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/5 "2006-08-06T09:31:07Z")

</div>

my java version is as follows:

Servoy Developer  
Version 3.0b3-build 364  
Java version 1.5.0\_07-b03 (Windows XP)

does it make any difference?

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 6, 2006, 10:11am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/6 "2006-08-06T10:11:31Z")

</div>

Hmm…I was mistaken.  
When I made the button larger I see the same as you.  
Only workaround I see is to set the width in pixels instead of percent.

This behavior is in Servoy 2.2.5 and 3.0b3 (Mac and Windows)

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [August 6, 2006, 10:32am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/7 "2006-08-06T10:32:35Z")

</div>

I can set the width in pixels for the buttons. The reason I wanted to set to 100% is because the size of the buttons are variable. I would like to set the table width to 100% and then show a small image on the right hand side of the button as shown in the attachment. Now it is shown in the left hand side which is a bit ugly.

Any other work around to acheive this would be better.

Thanks for your time.

 ![img_1.gif](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/c/cdbd059553355461550da582f3e6eb4c466ab442.gif)

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 6, 2006, 10:52am UTC](https://forum.servoy.com/t/html-table-in-action-buttons/6326/8 "2006-08-06T10:52:59Z")

</div>

I guess the following code would work.

```auto
<html><table>
	<tr>
		<td>your button name</td>
		<td><img src="yourimage.png" alt=""></td>
	</tr>
</table></html>

```

Also your HTML should be centered when your button has the showClick property enabled. Else use the horizontalAlignment property to center it.

Hope this helps.
