Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

08 Creating Tables and Lists

0 (0 Likes / 0 Dislikes)
This section of Introduction to Wolfram Notebooks is about formatting things like tables and matrices and bullet lists. Starting with bullet lists, one easy way to get a bullet or itemized list is to choose Item from the Style submenu under the Format menu, to get an Item cell and then enter the contents of the cell. Item cells have the property that pressing the RETURN key from within an Item cell generates a new Item cell, so items can be added just by typing RETURN. There is also a keyboard shortcut for creating an Item cell, which is to type an asterisk to create a new cell. For example, with the cell insertion bar where it is now, the input would, by default, become an Input cell. But if I type an asterisk as the first character, then the cell becomes an Item cell. So that is a way to enter an itemized list directly from the keyboard, without using the menus. Numbered lists can be created by choosing ItemNumbered from the Style submenu and proceeding much as before. The number is incremented automatically for each new entry. The number in those numbered items is the cell dingbat. A cell dingbat in general is just a marker on the left side of the cell. The numbering, however, can actually be inserted anywhere. For example, to get automatically numbered sections, I can enter a section heading and insert a number, by positioning the entry point where I want to put the number and choosing Automatic Numbering from the Insert menu, which brings up a dialog box that I can use to insert a number that will be incremented for each new section cell. I can insert more numbered sections by making a copy of that cell and pasting it wherever I want a new numbered section, and the number will be incremented automatically for each section. You can find more information about automatic numbering in the Wolfram Documentation in this tutorial on automatic numbering and in the documentation for the Automatic Numbering menu item. Moving on now to creating tables and matrices, an easy way to get a matrix is to choose the Table/Matrix item under the Insert menu. Choosing New from the submenu brings up this dialog box, where I can set various options and choose the number of rows and the number of columns. Here I will click the button to give a matrix and specify 3 rows and 3 columns and then click the OK button to get a 3-by-3 matrix in the notebook. The elements in that matrix are empty boxes called placeholders, where I can enter matrix elements. I will use the mouse to select the first placeholder and enter a value, then use the Tab key to move to the next placeholder and enter the next value, then use the Tab key again to move to the next placeholder and enter the next value and so on for the rest of the matrix. The Add Row and Add Column items in the Table/Matrix submenu can be used to add rows and columns to this matrix. To do that, I will click on the matrix to select where I want to enter a row or a column and then choose the Add Row or Add Column menu items. Those menu items also have keyboard shortcuts. CONTROL+RETURN creates a new row and CONTROL+COMMA creates a new column, and those keyboard shortcuts actually can also be used outside of a matrix to create a new matrix. For example, if I press CONTROL+RETURN in a place that isn't part of a current matrix, the effect is to generate a new matrix with one placeholder and add a row to that matrix, which gives a matrix with two rows and one column. Additional rows and columns can then be created by pressing CONTROL+RETURN to add rows and CONTROL+COMMA to add columns, so it is possible to create a matrix entirely using keyboard commands, without ever going to the menus. The system for formatting a matrix can also be used to format a table like this one. Start by choosing Table/Matrix from the Insert menu and click New to bring up the dialog box. This time I will select the Table button. I also want lines between the rows and lines between the columns and a frame around the table, so I will check all of those boxes and click OK to get the table. I could have specified a 6x5 table in the dialog box, but instead I will select an element in the table and use CONTROL+RETURN and CONTROL+COMMA to add rows and columns. Several of the entries in the desired table span more than one row or more than one column. To get those spanning entries, I will select the entries that are to be merged and choose Make Spanning from the Table/Matrix menu and repeat that process for the other elements that are combined in this table. All that remains now is to enter values for the elements in the table, but if I just start typing, all of the inputs are treated as variables or as other Wolfram Language commands, which happens because this is still an Input cell and input into an Input cell is treated by default as Wolfram Language commands. Sometimes that is fine, but since much of this table is plain text, it might be better to have text be the default. One way to make that happen is to change the style of this cell from Input to Text, and as long as I am changing the styles of things, I will also change the font using the Show Fonts dialog box. Now proceed with filling in the entries in the table. It is worth noting that this is still a live table that could have been generated or filled in automatically, and the table and parts of the table can be used as data in other computations. For example, I can copy some desired part of the table and paste that into the Total function to get the sum of the amounts in that part of the table. There is much more that can be done with the formatting of tables, some of which is introduced in the next section, and you can also find more information in the Wolfram Documentation, starting with this short tutorial on entering tables and matrices using the Table/Matrix menu item. And you can also follow links to this guide to all of the functions and options related to grids and tables.

Video Details

Duration: 5 minutes and 44 seconds
Language: English
License: Dotsub - Standard License
Genre: None
Views: 2
Posted by: wolfram on Jan 30, 2020

08 Creating Tables and Lists

Caption and Translate

    Sign In/Register for Dotsub above to caption this video.