HTML Table Format

  • Author
  • #1055861

    My site contains a number of data tables. In the past, I have imported them from Excel by saving the relevant spreadsheet as an HTML file, opening the file in Notepad, then pasting this into the HTML editor in WordPress.

    Recently, however, the visual editor has started to represent the HTML tables using a rather basic, visually unappealling format – quite different to the format used previously (for example, I’ve lost both the alignment of text within columns and fill colour of cells). The tables already uploaded to the site are fine, but if I make any edits to these pages then the tables will take on the new format.

    Has there been a recent update to the editor that has caused this? And is there a way I can switch back to the previous formatting system?

    The blog I need help with is



    See this answer from WordPress staff:

    Hi all,
    A change that we made last week is causing the Visual Editor to strip out attributes on table tags.

    To work around this for now, you will need to use the Text editor on any posts where you have tables. If you switch back to the Visual Editor before saving changes on those posts, the attributes will be deleted, so please make sure you save your changes if you switch back to using the Visual Editor.

    The developers do know about this, and we’ll keep you all up to date once we know anything further.


    I’ve tried to create a simple html table several ways this morning, including keying the code directly into the Text editor and saving that version without switching back to the Visual editor as you suggested. The outcomes is always the same unfortunately. WordPress reduces my table and its cells to a simple stack of rows the same length as the main paragraph. This doesn’t work.

    When you say that you’ll keep us all up to date once you know something further, how does that work? I’m fairly new to WordPress myself. I didn’t know about the changes you were making, so I’m not sure how I would know about the solution. Thanks.


    Moderator Emeritus

    What is the code you were trying to use? To post code here place it between backticks like so
    backtick — code — backtick
    (the backtick is ` and is usually on the same key as the tilde ~ next to the 1 and ! key)

    Or highlight the code with the code tag above the comment box.


    Moderator Emeritus

    As for staying up to date, you could try subscribing to this topic so whenever there is a new post you will be notified.

    Or check on this tag to see if there are new developments:

    Please note that this is a community forum and so for the most part we are volunteers answering your questions. We don’t know what staff is up to behind the scenes.


    Oh, wow. Really sorry. I didn’t realize this is manned by volunteers. Thank you so much for your time.

    The thing is this, I need to build a table with a bit of control over the cell sizes. This is a small example of what I’d like to do, but WordPress seems to ignore things like borders and column widths.

    <table border="2">
    <td> Mandarin, Simp.</td>
    <td>  电话 </td>
    <td> diànhuà</td>

    Thanks for any insight you have.


    Does anybody know if the original problem is any closer to being fixed? Tables in the Visual Editor are now being displayed with gridlines, but still not with correct fill colours, text alignment or column widths.


    No change in the ability to create tables in as far as I can tell. I updated my account to a customizable level thinking that that would allow me a little more flexibility. It doesn’t.


    I do manage to put colours and formatting in my tables (check my blog at, but I need to paste the code into the text editor and avoid carefully any switch to the visual before saving and publishing. I use the preview often to see the result, that’s it. It works but I do not like it at all, as crating posts with images, tables and links in the text editor is really confusing. This is why WP has a Visual editor after all!!! WP should fix this issue for good!



    You can currently add deprecated (obsolete) HTML attributes like border and bgcolor to table and tr tags, but not td tags. This should be reverted back to the way it was in a future update and you’ll once again be able to add deprecated attributes to td tags without having them stripped out.

    As a better alternative to using obsolete tags, you can always add inline CSS to td tags – such as:

    <td style="background-color: #000">data</td>

    If you have the Custom CSS upgrade, an even better method is to define a class in your stylesheet, and then apply it to your td, such as:

    .special {
    background-color: #000

    <td class="special">data</td>

    Keeping your styles separate from your HTML code is best practice.


    I will study this, but as I am using the default html generator within Excel to create the tables, I would need to process the code between creation and pasting into the post. I know I could probably even do it with a script, but that is annoying, especially because the procedure worked fine for quite a few years until the first week of October…
    Thanks kathrywp for taking time to explain me the possibilities with CSS!



    I understand the frustration – unfortunately, Excel produces really poor HTML code. :-(


    I see your point, but I spend so much time in generating the CONTENT of my blog that i hoped I could spend as little time as possible in caring about the format…I will really be very happy to go back to a situation where I can select the table from the html page in the browser (CTRL+A, CTRL+C), open the Visual Editor and paste it in the new post with CTRL+V like I could do in the past. So simple!!!



    Could anyone who’s posted here please let me know if your table code is once again working as it did before? I just did a test, and with the software update that happened overnight it looks like HTML attributes on td table cells are now being preserved.



    I will check more thoroughly, but I’d dare to say that the problem seems to be solved!!!
    Thank you kathrynwp! You are a real Happiness Engineer! ;-)



    Excellent – very glad to hear it!


    Thanks for looking into this, kathrynwp. There has been an improvement in the format of the tables since the latest update, but they are still not displaying as they were before the problem.

    Fill colours, gridlines and cell alignment have now returned, but the spacing is still awry, with several of the columns in my tables squeezed together. Before the problem, there was some space either side of the text in these cells, which made for a far more attractive and readable layout.



    testcricketleague – could you please provide a link to a post which isn’t displaying as you like, so I can take a peek? And a link to a post from before, which has the formatting you want? Thanks!


    Hi kathrynwp. Here are the links as requested:

    New format:

    Old format:

    Do let me know if you need any further info. Many thanks.


    Thanks for looking into this, Kathryn. My problem is similar to testcricketleague’s. I’ve got very little control over the width of my table row cells. Any light you can shed on the issue, coding tips, or work-arounds will be very much appreciated. I purchased the custom CSS upgrade, but did not discover in there any tools that allowed me to specify cell width.

The topic ‘HTML Table Format’ is closed to new replies.