Freigeben über


Inserting Tables Using the Keyboard

This post describes a little trick that lets you insert a table into RichEdit and into Word just using the keyboard. Admittedly in Word, you can use the handy table tool on the Insert tab with a mouse or with a keyboard. But in WordPad and the Windows RT RichEditBox, you don’t have a table tool.

So here’s the trick: on a line of its own type a plus (+) followed by as many dashes (-) as needed for the width of the first cell, followed by a plus to end that cell. If you only want a one column table, just hit the Enter key and you have a one cell table. To have more cells in the row, type more dashes and pluses, being sure to end the line with a plus. For example, hitting the Enter key at the end of the line

+-----------------------+---------+-------------------------------------+

inserts the table row

 

 

 

When you have as many cells as you want, to get another row, put the insertion point at the end of the row and hit the Enter key. Alternatively put the insertion point in the last cell and hit the Tab key. If the insertion point isn’t in the last cell of the table, a Tab advances to the next cell and a Shift+Tab backs up to the previous cell. When the insertion point is in the last cell of a table, the Tab key inserts another row. So pretty quickly you can enter a simple table with arbitrary numbers of cells, rows, and cell sizes. You can use the mouse to change the width of the columns.

You can also change the alignment of a table by selecting the whole table including the end of row marks and hitting ctrl+e or ctrl+r for centering and right-justifying the table, respectively. Ctrl+L left justifies the table. In Word there are a number of other cool tools such as the one to autofit the contents of a table (select the table, right-mouse click on it and choose the Autofit option).

Comments

  • Anonymous
    October 14, 2012
    Cool trick!! It is also possible to replace the dashes with blank spaces. Are there also some another hidden features in MS-Word that make possible to use keybord instead of mouse?

  • Anonymous
    October 14, 2012
    The comment has been removed

  • Anonymous
    October 14, 2012
    In Word, you can also type =rand(3,2)<enter> This inserts three paragraphs, each containing two sentences. This is a quick way to insert some text to play around with. Adjust the numbers to get more or less text.

  • Anonymous
    October 21, 2012
    Are these Office-2010-only features? I wasn't able to do it in Office 2007 or in WordPad.

  • Anonymous
    October 26, 2012
    The table feature was added in RichEdit 6.0 and Windows 7 has RichEdit 4.1. Windows 8 has a version of RichEdit 8. The table feature does work in all versions of Word that you can find, e.g., all the way back to Word 97. The =rand(n,m) feature is Word only. Maybe RichEdit should have it too...

  • Anonymous
    April 18, 2014
    Khup chan.........very nice.................hats off to those who invented this trick................lots n lots of thanks...