Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table craziness

Status
Not open for further replies.

richtestani

Instructor
May 3, 2004
20
0
0
I am trying to setup a table (or 2 tables) that fill the entire page. Each table is a 1 x 3 configuration filling a letter size sheet with lanscape orientation.

Problems arise with a second table on page 2. Originally had text wrap set, which made my second row disappear. Consulting Help, It said to use no text wrap in which the second row re-appeared. Problem was I could not get a full page table like the first row.

I removed the second row and tried to create a second table, but again for some reason when I used no wrap, it jumoed all the way up to the first page.


Does anyone have an idea whta I doing wrong?
Thanks
Rich
 
Hopefully I've understood your problem correctly.

On first page insert table of 3 columns 1 row, using cursor keys move cursor to right as far as possible. Press CTRL-ENTER insert table on second page. Adjust row height to fill page.
 
I don't know if I followed your explanation correctly, but...

With your cursor in the first cell of row 2, press Ctrl+Enter (Page Break).

Does that accomplish what you want?
 
Hmmm.
I am doing wha both of you reccomend but it does not seem to be doing anything. Should I mention I am using a Mac, but trying both command and control keys seems to produce no results.

What I did do was split the table which gave me the 2 rows on serperate pages.

But..it created a new iss. There are blank pages in between both tables. Why?
Thanks for you help.
Rich
 
I looked up the MAC keyboard shortcut for Page Break and it is Shift+Enter. As to the blank pages, I'm still trying to figure that out.

When you Show/Hide All (Command+8) (I think), is there anything after either of the tables (other than the Page Break)?
 
I suspect that part of the problem here is that Word inserts an empty para at the end of a table. So, if you create a table that fills a page, the next page must start with either a new para (or a continuation of the same table). A new table on the new page cannot therefore fill the whole page. You can get close to a new page's worth of table if you reduce the empty para's size to 0 leading/trailing space and set its font to 1pt.

Provided you format the trailing paras as outlined above, the following macro (PC version) should make each table fit its page's height with however many rows the table has, all evenly sized.

Cheers

Code:
Sub TableFit()
Application.ScreenUpdating = False
Dim oTopMargin As Single, oBottomMargin As Single
Dim oPageHeight As Single, oPrintHeight As Single, oRowHeight As Integer
Dim oTable, i As Integer
If ActiveDocument.Tables.Count = 0 Then Exit Sub
For i = 1 To ActiveDocument.Tables.Count
    oTable = ActiveDocument.Tables(i)
    With oTable.PageSetup
        oTopMargin = .TopMargin
        oBottomMargin = .BottomMargin
        oPageHeight = .PageHeight
    End With
    oPrintHeight = oPageHeight - oTopMargin - oBottomMargin
    oRowHeight = Int((oPrintHeight - 1) / oTable.Rows.Count) - 1
    With oTable.Rows
        .Height = oRowHeight
        .HeightRule = wdRowHeightExactly
    End With
Next
Application.ScreenUpdating = True
End Sub
 
Both reposnses are correct. The tables do add a paragragh after each and the tables are sent to a new page since it fills the entire page. Oddly deleteing the paragraph deletes the second table. Yet another wonderful display of complete control over this program.

The macro returned an error when trying to run on the Mac, saying function not defined, then the debugger highlights With in the For Loop. Not sure why, could be Mac implementation of VBA just not familiar with it enough.

Is it possible to make the height of the table large enough to fit both the paragrah and table but sitll have 100% width? I'm trying to find a trade-off.

Thanks all for the help on this one.
 
Hi richtestani,

The 100% width shouldn't be a problem. It's the height that's causing difficulties.

You can simply decrease each row's height by 1/3 of the height required for the trailing para marker. That includes both the font height and any leading/trailing space. You can maximise the space available for the table by reducing the empty para's size to 0 leading/trailing space and set its font to 1pt, as suggested in my previous post.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top