pressbooks / pressbooks-book

McLuhan is the default book theme for Pressbooks.
https://pressbooks.org
GNU General Public License v3.0
20 stars 16 forks source link

Centered Tables Don't Display Centered #249

Closed SteelWagstaff closed 5 years ago

SteelWagstaff commented 6 years ago

Prerequisites

Description

Tables do not center on the page in the web book when 'alignment' is set to center. More specifically, it appears that the CSS for .centeralign doesn't include margin-left: auto; and margin-right: auto; for tables where 'table properties' -> 'Align' is set to 'Center'.

Steps to Reproduce

  1. Insert a table in a book.
  2. Click inside a cell in the table, click table properties and change alignment to center screen shot 2018-08-10 at 2 14 01 pm
  3. The WYSIWYG shows a centered table, but when the chapter is saved/previewed, the table remains left aligned.

Expected behavior: I expected that the table would receive the class .centeralign and the CSS properties margin-left: auto; and margin-right: auto;, causing the table to be centered in the web book.

Actual behavior: The table received the class .centeralign, but the only CSS property it inherited was clear:both; If I edited custom styles to include table.aligncenter { margin-left: auto; margin-right: auto; } everything worked as expected, however. I don't know enough about how the theme uses mixins and SCSS to know how to suggest a PR unfortunately, but am willing to learn ...

System Information

Book Info

Book ID: 100 Book URL: https://wisc.pb.unizin.org/statsprimer/ Book Privacy: Public

Browser

Platform: OS X Browser Name: Chrome Browser Version: 67.0.3396.99 User Agent String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

WordPress Configuration

Network URL: http://wisc.pb.unizin.org/ Network Type: Subdirectory Version: 4.9.7 Language: en_US WP_ENV: production WP_DEBUG: Disabled Memory Limit: 64M

Pressbooks Configuration

Version: 5.4.5 Book Theme: Jacobs Book Theme Version: 1.1.1 Root Theme: Aldine Root Theme Version: 1.4.1

Pressbooks Dependencies

Epubcheck: Installed Kindlegen: Installed xmllint: Installed PrinceXML: Not Installed Saxon-HE: Installed

Must-Use Plugins

Bedrock Autoloader: 1.0.0 hm-autoloader.php: n/a network-storage.php: n/a TablePress Quick LaTeX Functionality Plugin: 0.1.1 telemetry.php: n/a Unizin Allow Custom Post Types: 1.0 Unizin Allow Plugins: 1.0.0 Unizin Allow Upload Extensions: 1.0.0 Unizin Mail From: 1.0.0 UW-Madison Kaltura Enable oEmbed: 1.0

Network Active Plugins

CM Tooltip Glossary: 3.6.4 H5P: 1.10.3 H5P xAPI: 0.1.7 Hypothesis: 0.5.0 iframe: 4.3 LTI: 0.1 Pressbooks: 5.4.5 Pressbooks BISAC: 2.0.0 Pressbooks Cover Generator: 2.4.0 Pressbooks Stats: 1.4.1 Pressbooks Whitelabel: 1.2.0 Redis Object Cache: 1.3.8 Regenerate Thumbnails: 3.0.2 TablePress: 1.9 TablePress Extension: DataTables Buttons: 1.1 Thin CC Exporter: 0.1.1 User Activation Keys: 4.6 Wisc Content Auth LTI: 0.2.7 Wisc H5P LTI Outcomes: 0.2.6 WP QuickLaTeX: 3.8.4

Book Active Plugins

Inactive Plugins

Akismet Anti-Spam: 3.3.4

Server Configuration

PHP Version: 7.1.17-1+ubuntu16.04.1+deb.sury.org+1 MySQL Version: 5.6.10 Webserver Info: nginx/1.13.12

PHP Configuration

Safe Mode: Disabled Memory Limit: 256M Upload Max Size: 50M Post Max Size: 50M Upload Max Filesize: 50M Time Limit: 300 Max Input Vars: 1000 URL-aware fopen: On (1) Display Errors: N/A

PHP Extensions

OPcache: Zend XDebug: Disabled cURL: Supported cURL Version: 7.47.0 imagick: Not Installed xsl: Installed

greatislander commented 5 years ago

@SteelWagstaff I believe this has been fixed via https://github.com/pressbooks/pressbooks-book/commit/e731b4fd98b519bf9c6d321cde3b9645a1dabcf8.

Duplicate of #332 and #344.