Answered Table with columns with variable width

  • Saturday, June 11, 2011 12:34 PM
     
     

    Hi all,

    I use MS Word 2003 and winxp.

    Someone gave me a MS Word 2003 document where in one table the width of columns 2 and 3 depend on which row you are in! You can see an image of the table at http://www.easyquestion.net/learninginadigitalworld/wp-content/uploads/2011/06/art.jpg.

    It is not two tables, just one. When I click a cell and choose "select table" all rows are selected.

    Can anyone explain this behaviour?

    I have found out that if I check "Preferred width" for the two columns in question and center the table it looks OK. But why should this be necessary? 

    I have tried to write VBA code to check the two boxes, but with no success. What I have tried is explained at http://www.easyquestion.net/learninginadigitalworld/2011/06/11/using-googledocs-for-creating-report-cards/.

    Regards,

    Jan Nordgreen

Answers

  • Saturday, June 11, 2011 1:34 PM
     
     Answered

    Hi Jan,

    You can get this behavior when someone tries to adjust the cell width in a single row and their adjustment is not consistent with all other cells in the table. That's probably not a great explanation so I'll try to explain it also another way.

    A table consists of one or more attached rows. In a multiple row table, each row can contain multiple columns. However, the column widths must be consistent for all rows; else you can get strange alignment and cell selection issues.

    For example if you have a multi-row table and each row is 6 inches in width and row 1 has two columns, each being 3 inches in width.  Row two can also have two columns but these columns should also be 3 inches in width. If column 1 of row 2 is set to 1 inch and column 2 is set to 5 inches, problems with table cell alignment will occur.

    There are ways to deal with this and it involves creating a table row with the most columns you will need and then merging the various cells to create the various cell widths for each row.

    So back to the example of my 6 inch wide row … if I determined that my need is to have a maximum of 6 columns I would divide my first row into 6 columns. Now row 1 only required 2 columns, so I would merge columns 1-3 and columns 4-6. Row 2 requires column 1 to be 1 inch and column 2 to be 5 inches so I would add a row, which would bring in a duplicate of row 1 that I would then split back into the original 6 columns and then merge columns 2 – 6 into a single column.

    Hope this helps

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    • Marked As Answer by damezumari Saturday, June 11, 2011 3:00 PM
    •  

All Replies

  • Saturday, June 11, 2011 1:34 PM
     
     Answered

    Hi Jan,

    You can get this behavior when someone tries to adjust the cell width in a single row and their adjustment is not consistent with all other cells in the table. That's probably not a great explanation so I'll try to explain it also another way.

    A table consists of one or more attached rows. In a multiple row table, each row can contain multiple columns. However, the column widths must be consistent for all rows; else you can get strange alignment and cell selection issues.

    For example if you have a multi-row table and each row is 6 inches in width and row 1 has two columns, each being 3 inches in width.  Row two can also have two columns but these columns should also be 3 inches in width. If column 1 of row 2 is set to 1 inch and column 2 is set to 5 inches, problems with table cell alignment will occur.

    There are ways to deal with this and it involves creating a table row with the most columns you will need and then merging the various cells to create the various cell widths for each row.

    So back to the example of my 6 inch wide row … if I determined that my need is to have a maximum of 6 columns I would divide my first row into 6 columns. Now row 1 only required 2 columns, so I would merge columns 1-3 and columns 4-6. Row 2 requires column 1 to be 1 inch and column 2 to be 5 inches so I would add a row, which would bring in a duplicate of row 1 that I would then split back into the original 6 columns and then merge columns 2 – 6 into a single column.

    Hope this helps

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    • Marked As Answer by damezumari Saturday, June 11, 2011 3:00 PM
    •  
  • Saturday, June 11, 2011 3:04 PM
     
     

    Hi Rich,

    Thank you for your answer!

    You were right. I checked the cell width for some of the rows and they were different from the rest. (This created havoc when I imported the document into GoogleDocs. I got an extra column.)

    By setting the same cell width and checking the columns' preferred width and aligning the table again it looks and behaves OK. The alignment was necessary too.

    I will now hunt down the one who made the table in the first place ... :)

    Regards,

    Jan