cancel
Showing results for 
Search instead for 
Did you mean: 

Change cellpadding in TableControl

Former Member
0 Kudos

Hello,

I'm trying to change the cellpadding and cellspacing HTML properties of a SAP.Web.UI.Controls.Table but can't find the way to access these properties.

Can anyone provide some help?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Elias Marin,

You can find the cellpadding and cellspacing of table.

It's very easy to find out.

I assume that you are working in Visual Studio .NET Studio.

<b>In Design Time</b>

In the design section of your html page

1. Drag and Drop the Table control from the web forms section.

2. Right Click the table and click properties...

3. You can see all the properties of the control.

(Including the cellpadding and cellspacing)

<b>In Runtime</b>

In a subroutine or a function you can set the properties like...

table1.CellPadding = <value>
table1.CellSpacing = <value>

Where,
table1 - id of you table control.

Hope it solves your problem.

Regards,

Maheswaran

Former Member
0 Kudos

Hi Maheswaran,

What I'm trying to modify is for a SAP Netweaver Table Control not the Web Forms Table Control.

I'm using PDK 2.0 with VS.NET 2003

Former Member
0 Kudos

Hi Elias,

SAP controls are meant to be rendered as SAP controls are rendered (for unity of look and feel). This means That you are not supposed to edit html properties of these controls, and only work with controls properties (cellpadding is not a property of the table or the cells AFAIK - but I could be wrong). This way, a table always looks like a table and a label always looks like a label, whether you created it or someone else did (for example, you don't set the color of the label, you set it's design).

To change the look of SAP controls (The PDK version of these controls and all others), you need to modify the portal theme.

So if you want your own design of UI (which is up to you, with it's benefits and downfalls), you can use other controls (SAP even encourages you to do it, and even offered an integrated tool called "Portal Style Designer" to help you with that).

With that said, you could always "hack" your way in, and use JS to add properties to html controls (in the page load client event).... But that is not supported nor recommended.

Hope that someohow answered your question!

Regards,

Ofer

Former Member
0 Kudos

Thanks Ofer I was suspecting somehting like that..

Former Member
0 Kudos

Hi Elias Marin,

Sorry!

I mistook the Control Class.

Ya! You are right there are no cellpadding or cellspacing for the sap table.

If you want to display the text at the center of the cell... then you can use the halign and valign of the cell attribute.

Hope it helps.

Regards,

Maheswaran.B

Former Member
0 Kudos

Hi Elias,

Please mark this question as answered (unless of course you have more to ask on this subject...)

Thanks,

Ofer