Title: Table max width
Last modified: August 20, 2016

---

# Table max width

 *  Resolved [sfscorpio](https://wordpress.org/support/users/sfscorpio/)
 * (@sfscorpio)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/table-max-width/)
 * Hey,
 * I got a problem with the width of the whole table, which is bigger than the container.
   I can not align .tablepress via the necessary margins because it will hand on
   right side. Is there a way to set the max-width for all the tables to solve this
   problem?
 * Here my website with example to see the problem:
    [table hangs on right side and does not recognize the container](http://www.miasanrot.de/loscfcb-der-mehmet-scholl-sieg/)
 * would be awesome if we can solve this problem!
 * best wishes
 * [http://wordpress.org/extend/plugins/tablepress/](http://wordpress.org/extend/plugins/tablepress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/table-max-width/#post-3455032)
 * Hi,
 * thanks for your question.
 * The reason for this is the (kind of) weird HTML markup and CSS on the site. All
   paragraphs and heading (and via the “Custom CSS” that you added all tables) have
   a left margin or padding. A better way should be to apply this as a padding to
   the surrounding container, as that would fix this.
 * We can fix this with the current state, too, though. The problem is that the 
   tables are set to have a width of 100%. When then margin is added to that, the
   tables will just extend. So, the fix is to set their width to the desired width
   of the content area. In your case, this means, to just extend the “Custom CSS”
 *     ```
       .tablepress {
       	padding: 0;
       	margin: 16px 32px 16px 32px;
       }
       ```
   
 * to
 *     ```
       .tablepress {
       	width: 680px;
       	padding: 0;
       	margin: 16px 32px 16px 32px;
       }
       ```
   
 * As a side note: I noticed some CSS that you are using to hide the `<caption>`
   element in a table. My assumption is that you are doing this to hide the “Edit”
   link? Then this CSS is not actually necessary, as regular site visitors will 
   never see the link. Only user who are logged-in to WordPress and who are allowed
   to edit that table can see that link.
 * Regards,
    Tobias
 *  Thread Starter [sfscorpio](https://wordpress.org/support/users/sfscorpio/)
 * (@sfscorpio)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/table-max-width/#post-3455034)
 * Thanks a lot! I’ll talk to our CSS guy.. he should optimize the code to avoid
   future problems.
 * Yes, the “Edit” is disabled because we don’t like to see it. It would be nice
   to disable it with some plugin options and not css. Maybe in the future.
 * Thanks and have a great sunday!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/table-max-width/#post-3455050)
 * Hi,
 * well, your CSS isn’t really a “problem”, but let’s say that there are easier 
   ways of handling things.
 * Oh, and I forgot one thing: Your table uses the “colspan” feature to combine 
   cells. Unfortunately, a table like that is then not compatible with the JavaScript
   library that adds the sorting and filtering functionalty. This is (at least for
   me) raising a JavaScript error message. You should therefore uncheck the “Use
   DataTables” checkbox on the “Edit” screens of a all tables that use colspan or
   rowspan.
 * About the “Edit” link: There’s a TablePress Extension that can do this (without
   CSS). Please see [http://tablepress.org/extensions/remove-edit-link/](http://tablepress.org/extensions/remove-edit-link/)
   for the download and instructions.
 * Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Table max width’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/table-max-width/#post-3455050)
 * Status: resolved