Working with Tables in the CMS
This is an advanced topic. Please do not attempt to edit tables unless you are fully comfortable with all other CMS topics and prepared to deal with the possibility of lost data.
Tables are troublesome beasts in the CMS, but there are times when you just can't do without them. The are some tricks that can be used to help soften your experience with CMS tables.
First it's important to know when you should and should not use tables:
- DO NOT use tables to format your pages.
- DO NOT use tables to right or left justify a piece of text, or to apply a caption to an image.
- DO NOT nest tables. There are better ways of doing anything that can be done with nested tables.
- DO use tables when you have tabular data to display.
Important Note on Empty Cells: The CMS eats empty table-cells--all cells must contain something, and a space isn't enough. We suggest "--" for empty cells.
Before editing a page with tables, we suggest that you create a copy of the page and experiment on it first.
- Creating tables in the CMS
- Copying a table to the CMS
- Changing Table Properties
- Changing Cell Properties
- Working with rows and columns
It is often easiest to initially create your table in Excel, or another speadsheet program and paste it into the CMS, however, it is possible to create tables in the CMS.
To create a table, look for the create table icon. It looks something like a grid with a pencil on it.
Click on the icon to bring up a context box. Enter the number of columns and rows you want (you can change these later). Don't set the border or cellpadding/spacing/alignment here. If you need something different from the defaults, contact firstname.lastname@example.org.
You may enter text anywhere in the grid to start building your table. Click in a cell to place the cursor there. Cells in your table will automatically expand and contract to accomidate your text.
If you have an existing table in a spreadsheet it can be copied into the CMS.
Select only the cells you wish to copy in your spreadsheet program (Do not select the entire sheet, and do not use any shortcuts that select rows to infinity), copy them, and paste them into your CMS page.
Copying from spreadsheets can cause various problems! So long as your table is a straightforward table, with no multi-cell text, blank columns put in for formatting, or formulas applied to the cells, you wil be OK. Complicated tables may cause the CMS to crash. Thanks to some modifications to the editor's default, we've now gotten it to handle some pretty nasty table pastes, but there's still always the chance that it could choke. Be sure that if you're going to play with complicated tables you understand how to rollback page changes.
Tables can have widths, cell-spacing, cell-padding and boarders. To change any of these, right-click anywhere on your table and choose Table Properties.
Width: You may give your table a width by entering it in the width box. Please only use percentage widths. Pixel widths may cause your page to fall apart. You may use any percentage up to 98% safely. Don't forget to enter the "%" or your table will think you meant pixels!
Height:NEVER enter a table height. It doesn't work properly, and is more likely to cut your text off, or ruin your page than it is to actually affect the height of your table.
Cell Spacing: Cell-spacing affects the space between cells outside the the border. We prefer that you not use cell-spacing; instead contact us to see if there is a table style for you.
Cell Padding: Cell-padding is the space between cells inside the border. We prefer that you not use cell-padding; instead contact us to see if there is a table style for you.
Class: Applies a pre-designed table style to your table. Currently the only class of interest is centered (does what it sounds like it does), but there is the potential for there to be a handful of useful styles. Ask if you're interested; we may be able to add something to the list.
Border: The border draws a line around your table and around each cell in your table.We prefer that you not use border; instead contact us to see if there is a table style for you.
Additionally we have some table styles that can give you collapsed borders (hairline borders), vertical alignments in cells, and other such things that can't be done easily with basic table attributes. Contact email@example.com if you have a table that needs that sort of treatment.
Text within a cell behaves just like text outside of a cell, and may be bolded, italicised, left- or right-justified, and centered by using the buttons at the top of the BodyCopy box.
You may also edit some attributes that are specific to cells by right-clicking on your cell (be careful to click on your cell, not on its border) and choosing Cell->Table Cell Properties.
Width: You may give your cell (and the entire column it is in) a width by entering it in the width box. Please only use percentage widths.
Height:NEVER enter a cell height.
Horizontal Alignment: This aligns text in your cell and can be easier done with the right/left/center buttons at the top of your BodyBox.
Class: As with tables, you can choose one of our pre-defined styles for your cell.
Important Note: before trying anything below on an important table, practice practice practice! These actions are the ones most likely to break your table. Be sure you know how to use them.
For all the actions below, your first step is to right-click on the cell you wish to change, or right-click on a cell that is in the row or column you wish to change. Always double-check your cells!
Inserting and Deleting Rows
Rows may be inserted by choosing the Row->Insert Row Before or Row->Insert Row After options from the right-click menu. Double-check that your cursor is in the proper row before clicking these options as they are applied immediately.
Deleting a row is done by choosing the Row->Delete Row option. Again, check to make sure you have the right row before clicking.
Inserting and Deleting Columns
Columns are inserted by using the Column->Insert Column Before or Column->Insert Column After options in the right-click menu.
Colums are deleted by using the Column->Delete Column option. Double-check to make sure your cursor is in the right column--once you click Delete Column, your column and all its content is gone.
Adding and Deleting Cells
While it is an option to add or delete cells in your table, we ask that you do not use these options. They work by adding a cell to or removing a cell from the row that your cursor is in, but they don't adapt other rows to make up for the changed cell. This makes a table with one row longer or shorter than the others, which really has no practical use and can result in a broken page.
Splitting and Combining Cells
Splitting cells can be done but again, we ask you not to use this option unless absolutely necessary. Generally, you are better off adding cells by adding an entire column than by trying to split a cell.
Combining cells, or "spanning" cells, can be used if you need to have a label that crosses several columns or rows. Don't combine cells just to get rid of a row or a column, use Delete Row or Delete Column instead.
To make a cell span, right click in one of the cells you want to merge, then choose Cell->Merge Table Cells. This will bring up a pop-up asking you how many rows or columns you want the cell to span. Update the numbers, and choose Update.
If you're really dextrous, you can select all the text in the cells you want to merge and hit Cell->Merge Table Cells. I only managed this on a hit-or-miss basis, so you may find the rows/columns method to be easier.
Note that the shape created by a span has to be a rectangle or a square--you can't span your cells into "corners".