Posts Tagged ‘tables’

h1

Word: Automatically sorting a list

June 10, 2015

Based on a Writing Tip sent to my work colleagues…

***************

Based on a question I got today, I realised that some of you may not know that you can get Word to automatically sort a list for you, whether that list is a bulleted list of words or rows in a table (e.g. a list of terms or of numeric values).

Here’s how.

  1. Turn off track changes if it is on.
  2. Select the bulleted list or click anywhere in the table.
  3. Click the AZ icon on the Home tab to open the Sort window.

    sort01
  4. On the Sort window, select how you want the list sorted – the default is ascending (alphabetically if words, numerically if numbers) and by the first column (if you are in a table). The options available on the Sort window vary depending on whether you’re sorting a table or not.
    sort02
  5. Click OK.

That’s it! Your list is now sorted.

 

h1

Word: Table or table row goes to next page

September 18, 2014

Based on a  writing tip I wrote for my work colleagues.

********************

Sometimes a table or a table row can shift to a new page and you don’t know why or how to get it back. There are several possible reasons a table or table row might do this, and several ways to get the table or row back to where you want it.

Table rows

There are three main reasons for a table row to start on a new page:

  • Table setting for ‘Allow row to break across pages’: Select the table row, right-click and select Table properties. Go to the Row tab, and see if Allow row to break across pages is checked or not. If it’s not, a row with a lot of information will start on a new page instead of splitting across the page break.

table_rows2014_03

  •  Paragraph setting for forcing a row to remain with the following row or paragraph: Select the first table row that’s on the new page, go to the Home tab, and click the tiny little arrow icon in the bottom right corner of the Paragraph group (see image below) to open the Paragraph dialog box. Go to the Line and Page Breaks tab and see if Keep with next and/or Keep lines together are checked. If so, that means that the row you selected is set to stay with the following paragraph, whether that’s another row or a normal paragraph.

 

  •  Paragraph setting for forcing a row onto a new page: Select the first table row that’s on the new page, go to the Home tab, and click the tiny little arrow icon in the bottom right corner of the Paragraph group to open the Paragraph dialog box. Go to the Line and Page Breaks tab and see if Page break before is checked. If so, that’s what’s forcing the row to the next page.

table_rows2014_01

table_rows2014_02

Entire table

 

Now, what about tables starting on a new page when they probably shouldn’t? Again, there are several reasons for this occurring:

  • Hard page break or empty lines (paragraphs) inserted in front of the table: Delete the page break and/or empty paragraphs and see if the table moves back.

 

  • ‘Section break (Next page)’ inserted in front of the table: BEWARE! Deleting section breaks can mess up page orientation and/or headers/footer. If you do delete a section break, check that nothing else was changed on the pages on front of the table AND after it (check the page orientation and headers/footers); if it all goes pear-shaped, immediately undo the deletion of the section break.

 

  • Paragraph setting for forcing the header row onto a new page: Select the first table row that’s on the new page, go to the Home tab, and click the tiny little arrow icon in the bottom right corner of the Paragraph group to open the Paragraph dialog box. Go to the Line and Page Breaks tab and see if Page break before is checked. If so, that’s what’s forcing the row to the next page.

 

  • Paragraph setting for forcing one or more rows to remain with the following row or paragraph: Select the entire table, go to the Home tab, and click the tiny little arrow icon in the bottom right corner of the Paragraph group to open the Paragraph dialog box. Go to the Line and Page Breaks tab and see if Keep with next and/or Keep lines together are checked. If so, that means that table is set to stay with the following paragraph. If either of these check boxes is shaded, it means some of the rows are set to ‘Keep with next’ and/or ‘Keep lines together’ so click the check boxes until they are clear.

 

One way to check if there’s a paragraph setting that’s controlling the table row(s) is to have your formatting marks turned on and look for a little black square at the far left of a table’s row(s). That black square indicates that a paragraph setting (not a table setting) applies to the row(s). For more details on turning on your formatting marks and the black square, see:

table_rows2014_04

[Links last checked September 2014]

h1

Word: Assigning automated cross-references

August 8, 2014

Based on a Writing Tip I wrote for my work colleagues. Warning: LONG! as there are different instructions for each type of cross-reference.

****************

In many of the Word documents you write, you may need to refer the reader to another section, an appendix, a table, or a figure, or numbered reference in a References list. You do this with a cross-reference (e.g. ‘see Table 5-2’). Although you can just type the cross-reference (x-ref), if you add more sections/tables/figures etc. or delete some, then some or all of your typed x-refs will be incorrect and take the reader to the wrong place.

The solution is to use automated x-refs.

That way, when you add/move/delete sections/tables/figures etc., you just need to update the fields in your document to automatically update the x-ref numbers to reflect the new numbering of these elements. The other advantage of automated x-refs is that they are clickable in the Word document (Ctrl+click) and sometimes in PDFs (depending on the Acrobat settings) – in both cases, clicking the link will take you straight to the place referred to.

Assumptions: All the instructions below assume you are working in a document that is based on a template that uses:

The instructions vary a little for each type of cross-reference—figure/table, section, appendix, numbered References list item. However, for each you will start with the References tab > Captions group > Cross-reference button:

x-ref_refs_tab

 

Insert an automated cross-reference to a figure or table

  1. Place your cursor in the text where you want to insert the cross-reference.
  2. Go to the References tab > Captions group, then click Cross-reference.
  3. In the Reference type field, click the drop-down arrow and select either Figure or Table (they’re at the bottom of the list).
  4. In the Insert reference to field, click the drop-down arrow and select Only label and number.
  5. Select the figure or table from the list in the lower half of the dialog box.
  6. Click Insert.

x-ref_fig-table

Insert an automated cross-reference to a section

  1. Place your cursor in the text where you want to insert the cross-reference.
  2. Type the word ‘Section’ and a space.
  3. Go to the References tab > Captions group, then click Cross-reference.
  4. In the Reference type field, click the drop-down arrow and select Heading.
  5. In the Insert reference to field, click the drop-down arrow and select Heading number (no context).
  6. Select the section from the list in the lower half of the dialog box. Hint: If it’s a long list, type the main section number – e.g. type 8 to take you straight to headings starting with ‘8’.
  7. Click Insert.

x-ref_section

 

Insert an automated cross-reference to an appendix

  1. Place your cursor in the text where you want to insert the cross-reference.
  2. Go to the References tab > Captions group, then click Cross-reference.
  3. In the Reference type field, click the drop-down arrow and select Numbered item (first in the list).
  4. In the Insert reference to field, click the drop-down arrow and select Paragraph number (no context).
  5. Select the appendix from the list in the lower half of the dialog box. Hint: Appendices are always listed at the END of the list, so you might have to scroll down a long way.
  6. Click Insert.

x-ref_appendix

 

Insert an automated cross-reference to an auto-numbered Reference list item in a citation

  1. Go to the References section, note its section number (e.g. 9.0), then identify the row number in the References list for the document you want to cite (e.g. row number 23).
  2. Place your cursor in the text where you want to insert the cross-reference.
  3. Type ‘(Ref. )’; make sure you add a non-breaking space (Ctrl+Shift+spacebar) after the full stop, then put your cursor after the space and before the closing parenthesis.
  4. Go to the References tab > Captions group, then click Cross-reference.
  5. In the Reference type field, click the drop-down arrow and select Numbered item (first in the list).
  6. In the Insert reference to field, click the drop-down arrow and select Paragraph number (no context).
  7. Go to the References section (e.g. 9.0)  in the lower half of the dialog box.
  8. Scroll down the list of numbers after the section number/heading and select the number of the row you identified in Step 1.
  9. Click Insert.

x-ref_citation

What happens to the x-ref numbers if I’ve added new tables/figures/sections etc.? How do I update them?

When you add a new section, table/figure, appendix etc. Word automatically applies the correct sequential number for where you’ve placed it. If you move an existing section or appendix, these heading numbers will change automatically too. But tables and figures and all the x-refs DON’T change their numbers until you update all the fields in your document.

Although there are several ways to update all the fields (and therefore the automated numbers), the quickest, simplest, and most foolproof way is to switch to Print Preview mode, then switch back—almost all your numbers automatically update:

  1. IMPORTANT: Make sure Track Changes is turned OFF. Weird things happen if track changes is on, including possibly losing your x-refs!
  2. Go to File > Print. The print preview of your document shows on the right.
  3. Go back to the Home All your fields are updated automatically.

That’s it!

However, this method doesn’t update your table of contents, list of tables, list of figures, etc.—you have to do those separately using the applicable Update Table buttons on the References tab, or use the method below.

To update EVERYTHING in your document at once:

  1. IMPORTANT: Make sure Track Changes is turned OFF.
  2. Select the entire document (Ctrl+A).
  3. Right-click on the selection and select Update Field.
  4. When asked about updating the table of contents etc. select Update entire table and click OK. You may have to answer this several times for each contents list.
  5. Repeat steps 3 and 4 once more to be sure you got everything. Sometimes, the first update will update the numbers for moved figures/tables etc. but not the x-refs too—to be certain you update the x-refs, repeat these steps a second time.

 

TROUBLESHOOTING

What does ‘Error! Reference not found.’ mean?

You’ll get ‘Error! Reference not found.’ for any x-refs that have nothing to point (refer) to. The most common reason for these error messages is that you’ve deleted a section heading (or a figure/table caption) without realizing that there was a x-ref to it somewhere else in the document. Behind the scenes, Word has unique ID numbers for each x-ref that refers to specific sections, tables, etc. So if you delete the section heading/caption but not the x-ref, Word loses the connection between the two when the fields are updated, and so reports ‘Error! Reference not found.’. The only simple solutions are to:

  • delete the message if the table etc. has been deleted, OR
  • replace the message by creating a new x-ref to the correct place.

What about Section 0?

If you notice some ‘Section 0’ x-refs after you update the fields, there’s a good chance you inserted a new paragraph by pressing Enter at the beginning of an existing section heading and then changed the style of the new paragraph. This screws up the internal IDs. Best practice is to insert a new paragraph at the END of the previous paragraph by pressing Enter. For detailed information on this problem and various methods of solving it, see: http://www.thedoctools.com/demos/demo_crossref_2.html

**********************

See also:

[Links last checked August 2014]

h1

Word: Using tables more efficiently

April 30, 2014

Based on a Writing Tip I wrote for my authors.

********************

We use tables in many of the Word documents we write. Most of the tips below refer to commands on the Table Tools > Layout ribbon:

tables_ribbon

  • Make the table fit the width of the page: Click anywhere in the table, go to the Table Tools > Layout ribbon, then click AutoFit > AutoFit Window.
  • Make selected columns the same width: Select the columns, go to the Table Tools > Layout ribbon, then click Distribute Columns.
  • Sort a table into alphabetical order by the first column (ideal for a list of terms): Click anywhere in the table, go to the Table Tools > Layout ribbon, then click Sort. By default, the sort options are by Column 1, Text, Ascending, and No Header Row, which is correct in most cases for a Terms list, so click OK.
  • Add a new row in between other rows: Select the row below where you want the new row, go to the Table Tools > Layout ribbon, then click Insert Above.
  • Show gridlines on a borderless table: It’s really hard to see where the table cells are in a borderless table, so turn on the gridlines so you can see where the edges are. Click anywhere in the table, go to the Table Tools > Layout ribbon, then click View Gridlines. This setting holds for all documents until you turn it off.
  • Force a row to NOT break over a page: Select the row that you don’t want to split onto the next page, right-click and select Table Properties, select the Row tab, then clear the Allow row to break across pages check box.
  • Make the top row a header row that flows onto the next page when the table splits across a page: Select the first row of the table (you might select more than one row, depending on your column headers and how they are arranged), go to the Table Tools > Layout ribbon, then click Repeat Header Rows.
  • Force a row to stay with its following row, even if there’s a page break: NOTE: Use this one carefully and ONLY where you really need it – don’t use it for every table/every row. Select the row you want to keep with the next row, go to the Home tab, click the tiny grey arrow at the bottom right of the Paragraph section (or press Alt+O+P) to open the Paragraph dialog box, go to the Line and Page Breaks tab, then select the Keep with next check box.
  • Move a table row up or down: You can quickly move one or more table rows up or down a table by pressing Shift+Alt and either the up or down arrow key

Some basics on selecting table elements with the mouse

  • Select the entire table: Move your cursor over the table until you see the 4-way arrow inside a small box at the top left of the table, then click this 4-way arrow. If this 4-way arrow disappears before you can click it, move your cursor away from the table, then back over it to see it again.
    tables_select_table
  • Select a column: Move your cursor to just above the column until it turns into a small black downward-pointing arrow, then click to select the column the arrow is pointing to. You can select more than one column by dragging immediately after clicking the first column.
    tables_select_column
  • Select a row: Move your cursor to the far left of the table (outside it), until it changes to a cursor arrow, then click to select the row the cursor arrow is pointing to. You can select more than one row by dragging immediately after clicking the first row.

tables_select_row

h1

Super easy zebra-striped tables using CSS selectors

October 16, 2013

I read about this trick in an article in the October 2013 issue of Australian Personal Computer (‘Powerful styling with CSS selectors’ by John Allsopp, p98-100) and thought I’d give it a try.

Wow! Super simple! Much better and cleaner than using JavaScript or coding each table row with an odd/even class.

The result

Here’s the result (ignore the ugly colors — they were just for testing the code):

zebra_tables01 The CSS

Here’s the code in my test CSS file that created the differently colored rows for odd and even rows (yes, I comment my code, especially where I can’t figure out what a color is by the hex value):

zebra_tables02

How simple and elegant is that! Basically just two lines of CSS and you’re done. Of course, substitute your own colors.

One caveat: If you have a TH row at the top of the table, it gets ‘counted’ as Row 1 (an odd row), so the color striping is ‘out’ by one.

The HTML

And here’s the bare bones HTML code I used for my test file:

zebra_tables03

Thanks for the article, John!

(John’s article has more on how this all works, and how to assign different column colors using math in the CSS, but for this post I just wanted to share the simplicity of the doing ‘zebra’ striped tables with CSS.)

h1

Word: Moving a table row quickly

February 18, 2013

Here’s a neat trick I learned from this post: http://www.techrepublic.com/blog/10things/10-tips-for-working-with-word-tables/3594

You can quickly move one or more table rows up or down a table by pressing Shift+Alt and either the up or down arrow key.

Who knew? That one was new to me, but I suspect I’ll use it quite a bit!

h1

Word: Number of rows and/or columns in a table

November 12, 2012

Jeff wanted to know how to find out how many rows he had in a very long table in his Word document. Word Count doesn’t tell you — it tells you how many lines in the document, but each cell (except one) in a table is treated as a ‘line’ for Word Count purposes.

You can find out how many rows (and/or columns) there are in an individual table by checking the table properties. Here’s how:

  1. Select the entire table. This selects all rows and columns.
  2. Right-click on the selected table and select Table Properties from the shortcut menu.
  3. Click on the Row tab — the number of rows selected is listed at the top of the dialog box.
  4. Click on the Column tab — the number of columns selected is listed at the top of the dialog box.
  5. Click Cancel to close the Table Properties dialog box.

NOTE 1: If you now select another table to check its number of rows and columns, you may find that when the Table Dialog box opens to the last-viewed tab (Row or Columns, no numbers are displayed. Just go back to the Table tab, then click the Row or Column tab again and the number will display.

NOTE 2: Merged cells are mostly treated as though the rows and columns existed as they did when the table was first created. However, if you’ve merged all the cells from several adjacent rows, the row count will reduce.