Drupal - Basic: Tables in Drupal



Tables in the WYSIWYG

You can also create a table in the WYSIWYG by putting your cursor where you want the table to be inserted and pressing the table icon in the WYSIWYG toolbar, then you can select how many columns and rows you want from the grid that appears:

screenshot wysisyg


Once you click on the last cell in the last row and column, an empty table will appear with a Table Dialog above it.  The Table Dialog has four icons. From left to right, they are as follows: Column, Row, Merge Cells, Toggle Caption on/off.  With these icons' down arrows, you can add or delete rows or columns, assign headers to rows or columns, merge or split cells.  The action you select will be applied to the column or row where your cursor is when you interact with the icons.


Accessibility Tip:  Tables should always have at least one header (row or column) so people with screen readers can understand the data you are presenting.

Since I wanted the first row to be a Header Row, I put my cursor in the first cell, interacted with the Row Icon dropdown and then toggled the Header row ON.  Once That is set, I can simply click back inside my table cell to start typing.

screenshot wysisyg table header options

As long as you are in the table, you have access to interact with the icons to amend the table as needed.


screenshot wysisyg table

Pasting tables from Word or Excel

You can also just put your cursor where you want the table to show up and paste the table from Google Sheets, Word or Excel right there.  As you can see, there are no headers. You would need to click into the table to amend the properties.


screenshot wysisyg table from wordtable from google sheets

You can also copy some cells from a Word table or an Excel spreadsheet and paste it right into the WYSIWYG or you can insert a table, highlight all the cells and then paste.  Here is how they look in the WYSIWYG.

When pasting a table or cells from a table from either Word or Excel, you have to clear formatting.  Luckily, this table didn't need it, as evidenced by the greyed-out Clear Format button circled in the screenshot below.

Editing an existing table

To make edits to your table, just click into your table and interact with the icons, or edit the text directly.

Add or delete rows by clicking on the table and using the row icon to access the options.

If you need to edit the table to, say, add a header row, you can click the icons to see what things you can do. You can add cells, rows, columns. You can add header row or header column by interacting with the correct icon.

screenshot wysisyg table cells


The rest of the things you can do is very similar to what you are used to with a typical WYSIWYG such as bold, italics, text alignment, and bullet points.

To Delete a table

Hover over the table and click on the upper left-hand box handle of the table

the border around the table will change from gold to blue, then press the backspace key.

Still need Drupal help? Have more Drupal questions?

If after reading this article or watching the training videos you still have questions, we can help!

Sign-up for any of our Drupal Drop-ins throughout the year. 

Schedule a Drupal training session for you or your whole department with our Drupal Trainer.

Questions?

If you have any additional questions or problems, don't hesitate to reach out to the Help Desk!

Phone: 610-526-7440 | Library and Help Desk hours
Email: help@brynmawr.edu | Service catalog
Location: Canaday Library 1st floor