8 Replies Latest reply on Jun 20, 2008 12:36 PM by MergeThis

    Table Style - Create and Apply

    Keith_Novice
      Is there a way throught the RH UI to create and store a Table Style (class) and then apply it to any table I create? I would prefer not to manually edit the CSS, create a class and then apply it in code (even if that's possible in RH).

      Thx,
      Keith
        • 1. Re: Table Style - Create and Apply
          Peter Grainge Adobe Community Professional (Moderator)
          Certainly not up to and including RH6. I don't think it can be done in RH7 either based on a recent post but haven't checked yet.

          • 2. Re: Table Style - Create and Apply
            Keith_Novice Level 1
            Peter,

            Well, although the answer is dissapointing I thank you very much! Now at least I can move forward on a work-around without feeling like I'm missing something obvious (I'm still on 5).

            You're the man!
            Keith
            • 3. Re: Table Style - Create and Apply
              Peter Grainge Adobe Community Professional (Moderator)
              I just copied the CSS style for tables from my site and it worked correctly in RH7 so it seems you can define styles via the CSS now.

              This was the definition I used.

              Table.thinborder {
              /* margin: auto auto;*/
              border-collapse: collapse;
              border: 1px solid #FF6347;

              }
              .thinborder td{
              border: 1px solid #FF6347;
              padding: 5px;

              }

              • 4. Re: Table Style - Create and Apply
                hylandwriter1 Level 1
                I am looking for a way to globally update (or apply) a table property - specifically the cell padding.

                I created a tabel style using your example and added it to my css, but I don't see it in th Format | Styles in the Robohelp UI. How do I access the style, or even apply it to an existing table?
                • 5. Re: Table Style - Create and Apply
                  Ben Minson Level 2
                  With Peter's example, you would have to apply class="thinborder" to each table that you want to use that style.

                  If you want every table to use the style (for example, your cell padding), in the CSS, just put:

                  table {
                  cell-padding: 5;
                  ...other styles...
                  }

                  Unfortunately, though I think table text styles do show up in RH's Styles editor or the styles dropdown, styles for tables themselves don't. Table CSS editing has to be by hand in a text editor (and the HTML code if you apply classes).

                  --Ben
                  • 6. Re: Table Style - Create and Apply
                    hylandwriter1 Level 1
                    Just so I understand -

                    I would have to go into the html for each table and add the "cell-padding:5;" right? If that's the case, I may as well just edit the properties in the UI. I just wasn't sure what you meant by

                    "(and the HTML code if you apply classes)."
                    • 7. Table Style - Create and Apply
                      Ben Minson Level 2
                      Sorry, I didn't specify that you make the table style changes to your CSS file. If you set a style in your CSS file as

                      table {
                      cell-padding:5;
                      }

                      then the padding will apply to all tables without further editing. Just like that. You won't have to do anything in the HTML to any new or existing tables to apply that style.

                      Peter's example shows styles for a table class called "thinborder." To apply those styles to tables, you'd have to go into your HTML and do this to each <table> tag where you wanted to apply the thinborder styles:

                      <table class="thinborder">

                      Hope this is clearer,

                      Ben
                      • 8. Re: Table Style - Create and Apply
                        MergeThis Level 4
                        "Styles" can get confusing when you're talking about HTML, not necessarily RH, tables. You can create your own table format "template" that consists of borders and fills, whereas you would assign styles to the characters you place within those table cells.

                        Open the C:\Program Files\RoboHelp Office\RoboHTML\Gallery\tables folder. The .htmtable files are the ones you see in the dialog Formats pane when you select Table > Insert > Table. (To ensure that our custom formats appear at the top, we added prefixes with a number and our product acronym, such as 1XXX_HEADER, 1XXX_NOHEAD, 2XXX_BLANK.) For steps in accomplishing this, check out "Rick's Method" at Peter Grainge's web site.

                        Then set up styles such as TableHead and TableRow for the font stuff, and you're good to go!


                        Good luck,
                        Leon