Enhance Content

28 Tables

Last update: Oct 31/23

""

See Create Tables in the Pressbooks User Guide.

Issues to Note

Styling tables can be a challenge when the CSS of a book overrides the HTML for individual chapters. For help with this issue, see Apply Custom Styles in the Pressbooks User Guide.

Table 1: Styling Tables
Formats affected Feature Problem Work around
Webbook Table cells with more than one paragraph The first paragraph in each cell will have no extra space between lines. All additional paragraphs in the same cell will have extra space between the lines and the text will be larger. (Problem reported to WordPress.) You have two options:

  1. Go into the Text (HTML) editor and add a blank line after the opening <td> tag (this means pressing the [Enter] key twice) and saving the chapter while still in the Text (HTML) editor.
  2. Go into the Text (HTML) editor at encase each paragraph within a table cell in <p> tags. Save the chapter while still in the Text (HTML) editor.
All formats Table borders and caption display After an update on December 21, 2018, borders were stripped out of many tables and table captions are displaying in light grey text below the table. To fix a specific table, select all cells in the table. Click the Tables icon in the WYSIWYG toolbar, and click under “Cell” click “Table cell properties.” Under “Class” select “Border.”

The following CSS will modify the display of all tables and table captions in a book. The CSS will need to be added to the Web, EPUB, and PDF Custom Styles (found under the Appearance tab in the Dashboard Menu):

/*Fix table accessibility/display*/

.front-matter td, .part td, .chapter td, .back-matter td, body#tinymce.wp-editor td {

border: 1px solid;

border-color: #373d3f;

}

.front-matter th, .part th, .chapter th, .back-matter th, body#tinymce.wp-editor th {

border: 1px solid;

border-color: #373d3f;

}

#content table caption {

caption-side: top;

color:#000;

text-align: center; }

License

Icon for the Creative Commons Attribution 4.0 International License

Pressbooks Guide Copyright © 2016-2022 by OER Production Team is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book