none
Word 2010 Show/Hide table columns

    Question

  • Hi,

    Is there a way to hide/show columns in a Word 2010 table? I would like to hide/display content based on a custom toggle button on the ribbon.

    Thanks, Dennis

    Tuesday, September 21, 2010 1:43 PM

Answers

  • Hi Dennis

    Word was not designed with the idea of showing/hiding colums or rows in its tables. As a Word processing tool, Word is mainly concerned with text layout. Showing/hiding columns is more something that's "dynamic interaction" - there are other tools for that kind of thing.

    When Word lays out a table, it respects things such as cell padding and font size, so it's close to impossible to completely hide a column (although it can sometimes almost be done with a row, by setting the font as "hidden" and the cell padding to 0).

    It sounds very much as if Excel would be what you need for these tables...


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Bessie Zhao Wednesday, September 29, 2010 9:58 AM
    Monday, September 27, 2010 8:21 PM

All replies

  • Hello Dennis,

    Thanks for posting. Via Word Object Model, there is no a way to hide/show columns of table in Word 2010. Also we could not hide/show columns in UI. I think you could try to delete/add column. For these methods, please see this MSDN page: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.columns_members.aspx. Also here is a MSDN page about how to add column which could help you: http://msdn.microsoft.com/en-us/library/2dw39e8e.aspx.

    If you have any concern for this post, just feel free to follow up.

    Best regards,
    Bessie Zhao - MSFT
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, September 22, 2010 5:23 AM
  • Hello again Dennis,

    I am writing to check the status of the issue on your side. Could you please let me know if the suggestion works for you or not? If you have any questions or concerns, please feel free to let me know. We will be more than happy to be of assistance.

    Best regards,
    Bessie Zhao - MSFT
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, September 27, 2010 10:09 AM
  • Hi Bessie,

    Thanks for following up. I am able to add/delete columns but that's not exactly optimal for what I'm trying to do. I'm trying to show/hide information based on a toggle button. The info I'm trying to show/hide will, in some cases, contain databound content controls and some other formatted text that is difficult to reconstruct in an add/delete scenario. And although I had only asked about column hiding, I was also interested in row hiding as well (I figured the technique would be the same if there was one, so there wasn't really a need to ask about each specifically).

    At this point, I'm just trying to think through some other solutions and come up with the best option. If you have any suggestions for me, I'd be glad to hear them. Thanks for your help.

    Dennis

    Monday, September 27, 2010 12:48 PM
  • Hi Dennis

    Word was not designed with the idea of showing/hiding colums or rows in its tables. As a Word processing tool, Word is mainly concerned with text layout. Showing/hiding columns is more something that's "dynamic interaction" - there are other tools for that kind of thing.

    When Word lays out a table, it respects things such as cell padding and font size, so it's close to impossible to completely hide a column (although it can sometimes almost be done with a row, by setting the font as "hidden" and the cell padding to 0).

    It sounds very much as if Excel would be what you need for these tables...


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Bessie Zhao Wednesday, September 29, 2010 9:58 AM
    Monday, September 27, 2010 8:21 PM
  •  The previous answer is incorrect.  If you want to hide table lines, left click on the plus sign next to your table.  Then click Border and Shadings.  You will be given an option of "None".  Click it and it will remove the lines.
    Tuesday, February 21, 2012 8:27 PM
  • I might suggest that Microsoft should consider providing the ability to hide cells/columns in Word tables.  I have a situation where I have created a document template using Advanced Properties to store certain values, and in the doc I want to be able to perform a calculation based on those values.  I'd like the calculation to be in-line with text in the document, but unless I can hide the three cells with the source numbers for the calculation the number I want in the text is preceded by a large gap in the text.

    Just my 2c


    John DeVito

    Friday, May 11, 2012 6:05 PM