Title: Embedding table into an email
Last modified: September 28, 2017

---

# Embedding table into an email

 *  Resolved [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/)
 * I have a WordPress page that I send out as an email newsletter. Everything looks
   fine, except the colors for the table are missing. Is there a way to embed the
   table from Tablepress into the email while maintaining the CSS?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/embedding-table-into-an-email/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/embedding-table-into-an-email/page/2/?output_format=md)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9537892)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * Unfortunately, I’m not aware of a solution for that, as I’m not an expert in 
   HTML email management. 🙁 Sorry.
 * Regards,
    Tobias
 *  Thread Starter [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9537920)
 * Hi no problem. Actually this is not about email but instead about CSS. A manual
   solution is to place the full CSS from tablepress into the email rather than 
   have a link, since links are stripped. So that is what I will do 🙂
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9537934)
 * Hi,
 * that’s what I meant 🙂 I have no clue how to embed CSS in emails. 🙂
    Good to
   hear that you found a solution!
 * Best wishes,
    Tobias
 *  [ericc44](https://wordpress.org/support/users/ericc44/)
 * (@ericc44)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9566739)
 * Hi WPChina and Tobias,
    i want to send Embedding Excel table into an email. Have
   you a solution ? I want to use a button and sending table at excel format to 
   a fix email adress. [ScreenPicture](https://prnt.sc/gup98w)
 * Thanks
    Best regards Eric
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9567313)
 * Hi Eric,
 * no, sorry, I’m not aware of a solution to that.
 * Regards,
    Tobias
 *  Thread Starter [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568179)
 * Ok, I have a solution. However, you must understand the requirements and shortcomings
   of emails first:
 * 1) Emails cannot have <form> inside. If they do, they will marked as phishing/
   spam by most recipients.
    2) Emails can’t access json or javascript because they
   also will be marked as phishing and spam messages. 3) Email programs will often
   strip out the <head> of an email. That means if you embedded CSS int he <head
   >, it will disappear. A workaround for this is to *also* place the CSS within
   the <body> of the email.
 * So that means when you embed your table into an HTML email, you can only expect
   to have the table contents available. You will not be able to have the search
   box, or other niceties like column adjustments.
 * To make the HTML email, I just add a file in my WP installation called email.
   php and I put it in a directory called /email/. So if my WP is installed at domain.
   com, the email is found at domain.com/email/email.php. I then add this to the
   top of the email.php:
 * `<?php require('../wp-blog-header.php'); ?>`
 * That one line of code will allow your email.php to act as if it is part of your
   WP installation.
 * Then I add the shortcode somewhere in the HTML body of the email.php like this:
 * `<?php echo do_shortcode("[table id=15 hide_columns=all show_columns='A,B,G,K'/]");?
   >`
 * Then it works. Just copy the HTML source of domain.com/email/email.php from your
   browser and paste it into your email program to send.
 * The downside is without the CSS, the table will just be text. So it will look
   bad. If you load the CSS in the <body?> it will look better, but I have an even
   better idea:
    Maybe allow TablePress to operate without any “outside” effects
   like json/css/etc. Instead just print a table and have CSS as part of the div
   to make the columns different colors. One way to do that is to allow some more
   parameters in the shortcode such as: a) external_files=off [this means the table
   relies on no external styles or code files] b) header_color=#669999 [this allows
   the header of the column to have specific color] c) footer_color=#669966 [this
   allows the footer of the column to have specific color] d) row_color_alternate
   =’#000066,#006666′ [this allows us to manually set the 2 colors to make each 
   row an alternating color. The first color in the list is the first color on the
   top row below the header, if the header is given its own color] e) table_border
   =2 [pixels for the border size] f) table_padding=5 [pixels for the padding size]
 * However, I found a bug, and I’m not sure if it a security issue….
 * If you login as admin to your WP within the same browser as you load domain.com/
   email/email.php you will see an “Edit” below the table. I actually didn’t pay
   attention the first time I did this, and I sent that to a few thousand members
   of a WP site I manage. So they could click on the Edit link and visit the WP 
   admin login page. They still needed a password to login, so it was relatively
   safe, but I’m unsure why the Edit link always shows and how to remove it. Any
   ideas?
    -  This reply was modified 8 years, 10 months ago by [WPChina](https://wordpress.org/support/users/wordpresschina/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568558)
 * Hi,
 * thanks for sharing this! I hope it has some pointers for eric44 that will help!
 * Regarding the “Edit” link: This is visible to users who are logged-in and who
   are allowed to edit tables. Now, of course, if this is cached or copied to the
   email content, it will be visible there as well. (Nobody will be able to use 
   it however, who is not allowed to edit tables!)
    You can still hide it if you
   want, using [https://tablepress.org/extensions/remove-edit-link/](https://tablepress.org/extensions/remove-edit-link/)
 * Regards,
    Tobias
 *  Thread Starter [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568576)
 * Thank you for the Edit link removal extension!
 *  Thread Starter [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568581)
 * Also, please look at my suggested parameters. Any chance we can include those
   in the future? 😉
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568606)
 * Hi,
 * no problem! Good to hear that the Extension helps!
 * As for the other Shortcode parameters: This would be something that you could
   try adding in a custom Extension. I don’t think it’s very useful for the majority
   of plugin users, in my opinion. Sorry.
 * Regards,
    Tobias
 *  [ericc44](https://wordpress.org/support/users/ericc44/)
 * (@ericc44)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568779)
 * Hi WPChina and Tobias.
    Thank you for your support.
 * Sorry, but actualy when we using EXCEL Button : we saving table to an Excel (.
   xlsx) file to local user machine.
 * I just want a new button to save this Excel (.xlsx) file to a fix email adress
   or web server or other…
    We want to offer the user the possibility of recording
   his result to a centralized place to make statistics of the choices of the different
   users.
 * Is it possible ?
    Thanks Best regards
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9568784)
 * Hi,
 * no, that will not work. All these buttens work on the client side only. For sending
   such emails, you would have to develop a custom server side script as well.
 * Regards,
    Tobias
 *  Thread Starter [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9617750)
 * I created an addon for this! I will send it to Tobias via email now.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9618277)
 * Hi,
 * awesome! Thank you for sending it to me! I will take a look at it shortly and
   then consider adding this to the other Extensions!
 * Best wishes,
    Tobias
 *  [ericc44](https://wordpress.org/support/users/ericc44/)
 * (@ericc44)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/#post-9637667)
 * Hi Tobias,
    is it possible to test this addon to send an email ?
 * Thanks WPChina for your addon, best regards.
 * Best wishes,
    Eric

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/embedding-table-into-an-email/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/embedding-table-into-an-email/page/2/?output_format=md)

The topic ‘Embedding table into an email’ 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/)

 * 16 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/embedding-table-into-an-email/page/2/#post-9640651)
 * Status: resolved