We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Table border (PpwerPoint 2010)

Medium Priority
410 Views
Last Modified: 2012-05-11
Please tell me how once can increase the thickness of just the top border of a table.
Also, I want to change the left and right margins of a table cell.

If possible, please give me a step-by-step procedure. Thanks!
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2011

Commented:
Set the cursor in the table, then on the draew borders pane, select the pen color, thickness etc then stoill on the same pane select the draw table button.\
Now click the mouse on the top or left/right borsers where you want the line.

Chris
CERTIFIED EXPERT
Top Expert 2011

Commented:
Alternatively select VBA, (alt + F11) followed by insert | Module


Now paste the following code therein

It set the top border to thickness 10, and incidentally changes the color but you can drop that if required

It then selects cell 4 in row 3 and sets the left and right borders to something else.  Modify the reference to the shape as appropriate, (the test slide had it as shape 3.

Chris
Sub topBorder()
Dim sh As Shape
    With Application.ActivePresentation.Slides(1).Shapes(3).Table
        With .Rows(1).Cells.Borders(ppBorderTop)
            .ForeColor.RGB = vbRed
            .Weight = 10
        End With
        With .Cell(3, 4).Borders(ppBorderLeft)
            .ForeColor.RGB = vbRed
            .Weight = 5
        End With
        With .Cell(3, 4).Borders(ppBorderRight)
            .ForeColor.RGB = vbGreen
            .Weight = 5
        End With
    End With
End Sub

Open in new window

Author

Commented:
Thanks! Can you tell me how one can change (increase)  the left and right margins of a table cell.
CERTIFIED EXPERT
Top Expert 2011

Commented:
To simplify shape selection for VBA you can for example, select the slide using the cursor.  Now on the Home tab, editing pane select "select" ... "Selection pane" from the drop down.

Find your table and change the name for example to Fred

Modify the selection in the earlier code from:

    With Application.ActivePresentation.Slides(1).Shapes(3).Table
to

    With Application.ActivePresentation.Slides(1).Shapes("fred").Table

Chris
CERTIFIED EXPERT
Top Expert 2011

Commented:
Via the application or VBA?

Author

Commented:
I'm not particular about the method.

Author

Commented:
Whichever is easier.
CERTIFIED EXPERT
Top Expert 2011

Commented:
INteractive note the draw borders pane requires the table to be selected then the design tab activated

Chris
CERTIFIED EXPERT
Top Expert 2011

Commented:
Easiest is probably VBA since we can read the current setting.  To do this replace:


            .Weight = 5
with

            .Weight = .Weight + 1

Chris

Author

Commented:
I am sorry. I meant, how do I increase the left and right margins for the contents inside a table cell.
Basically, I want to increase the left, right, bottom and top padding inside a cell.
CERTIFIED EXPERT
Top Expert 2011

Commented:
Select the table, layout cell margins

Author

Commented:
How do I get layout?
CERTIFIED EXPERT
Top Expert 2011

Commented:
Apologies ... in the cell margins, select custom to display the cutrrent internal margins and to adjust them.

Selecting a range of cells adjusts for all of the selected cells

Chris

Author

Commented:
I'm sorry, can you give me a step by step procedure. Where do I find cell margins?
CERTIFIED EXPERT
Top Expert 2011
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Thanks!
CERTIFIED EXPERT
Top Expert 2011

Commented:
Sorry I missed the difference between the margin and border requests, but glad it helped in the end.

Chris
CERTIFIED EXPERT
Top Expert 2011

Commented:
Looking at it but it's not so straight forward and will need VBA, (I believe) - if indeed it can be done at all!

Chris

Author

Commented:
Sure. I dont mind using VBA.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.