Open topic with navigation
You are here: Features > Tables > Editing Table Styles in Topic Style Sheets
Editing Table Styles in Topic Style Sheets
You can modify the look and feel of multiple tables at once by editing standard HTML table tags (e.g., <table>, <th>, <td>, <tr>) in your topic style sheet. For example, you might use these styles in order to control the look of the text that appears in your table headings (<th> style) or within the cells (<td> style).
How to edit table styles in a topic style sheet
-
Open the topic style sheet that you want to modify.
-
Complete one of the following sets of steps, depending on whether you want to use the Simplified view or Advanced view in the Stylesheet Editor.
- Simplified The Simplified view is better for new users. It provides an easier way to apply properties to styles, with format options available from a toolbar (similar to the way one would use the Text Format toolbar to change the look topic content without a style). In many cases, only the most common property options are available in the Simplified view (e.g., font, letter/word spacing, paragraph alignment/indentation, auto-numbering format, borders, background). One advantage of the Simplified view is that you can apply a property to multiple styles at the same time. You can also click a check box to hide the properties in the editor, allowing you to see only the styles.
- Advanced The Advanced view displays style classes and properties in hierarchical tree structures. It is not as quick as using the Simplified view, but it allows you to edit a great deal more settings than are available in the Simplified view.
If using the Simplified view:
- In the local toolbar, make sure the first button displays
(which means that the Simplified view is currently shown in the editor). If the button displays
instead, then click it.
- In the upper-left corner of the editor, click in the Show Styles field
and select Show Table Styles.
- From the grid below, select the appropriate table style.
- caption This tag lets you modify the table caption, which is a short title or description of the table's purpose. When inserting or editing a table, you can add a caption above or below the table.
- col This tag lets you group together attribute specifications for table columns. The <col> elements are empty and serve only as a support for attributes. They may appear inside or outside an explicit column group (i.e., <colgroup> element).
- colgroup This tag lets you group columns together structurally. The number of columns in the column group may be specified by using the element's <span> tag or by the <col> element, which represents one or more columns in the group.
- table This tag lets you modify entire tables. It contains all other elements that specify caption, rows, content, and formatting.
- tbody This tag lets you modify the main rows in a table (i.e., not the header or footer rows). Each <tbody> tag must have at least one <tr> tag within it, which is used to represent a single row.
td This tag lets you modify the data (or content) in the primary cells of a table.
When you press Enter after the first paragraph in a table cell, a paragraph <p> tag is added inside each <td> tag in that cell.
- tfoot This tag lets you modify a footer row in a table. When a table requires multiple pages in output, the footer row is repeated by default at the bottom of each page. Each <tfoot> tag must have at least one <tr> tag within it, which is used to represent a single row.
th This tag lets you modify the header content in a table. Why not just use the <td> tag for header content as well? First, by having different tags, you can more easily dictate one look for the header text (e.g., bold font) and a different look for the main content in the table (e.g., normal font). Second, using separate tags greatly assists users with visual disabilities, making it possible for multi-modal wireless browsers with limited display capabilities (e.g., Web-enabled pagers and phones) to handle tables.
When you press Enter after the first paragraph in a table cell, a paragraph <p> tag is added inside each <th> tag in that cell.
- thead This tag lets you modify a header row in a table. When a table requires multiple pages in output, the header row is repeated by default at the top of each page. Each <thead> tag must have at least one <tr> tag within it, which is used to represent a single row.
- tr This tag lets you modify single rows that are contained within <tbody>, <tfoot>, and <thead> tags. This tag can be used for setting page breaks on table rows. See Setting Page Breaks for Table Rows.
For more about each of these tags, please refer to http://www.w3c.org.
-
In the local toolbar of the editor, click
. The Properties dialog opens.
-
Use the fields on the various tabs to modify the settings for the style. The tabs included in the dialog depend on the type of style that you have selected.
Most tabs are the same as those used for regular paragraph formatting. For details about using the features on these tabs, see About Paragraph Formatting.
For the <td> and <th> styles, you also have access to the Text tab, which lets you set the alignment (top, middle, bottom), first-line indentation, and line height for the content in the cells.
- In the Properties dialog, click OK.
If using the Advanced view:
- In the local toolbar, make sure the first button displays
(which means that the Advanced view is currently shown in the editor). If the button displays
instead, then click it.
- In the upper-left corner of the editor, click in the Show Styles field
and select Show Table Styles.
- From the area below, select the appropriate table style.
- caption This tag lets you modify the table caption, which is a short title or description of the table's purpose. When inserting or editing a table, you can add a caption above or below the table.
- col This tag lets you group together attribute specifications for table columns. The <col> elements are empty and serve only as a support for attributes. They may appear inside or outside an explicit column group (i.e., <colgroup> element).
- colgroup This tag lets you group columns together structurally. The number of columns in the column group may be specified by using the element's <span> tag or by the <col> element, which represents one or more columns in the group.
- table This tag lets you modify entire tables. It contains all other elements that specify caption, rows, content, and formatting.
- tbody This tag lets you modify the main rows in a table (i.e., not the header or footer rows). Each <tbody> tag must have at least one <tr> tag within it, which is used to represent a single row.
td This tag lets you modify the data (or content) in the primary cells of a table.
When you press Enter after the first paragraph in a table cell, a paragraph <p> tag is added inside each <td> tag in that cell.
- tfoot This tag lets you modify a footer row in a table. When a table requires multiple pages in output, the footer row is repeated by default at the bottom of each page. Each <tfoot> tag must have at least one <tr> tag within it, which is used to represent a single row.
th This tag lets you modify the header content in a table. Why not just use the <td> tag for header content as well? First, by having different tags, you can more easily dictate one look for the header text (e.g., bold font) and a different look for the main content in the table (e.g., normal font). Second, using separate tags greatly assists users with visual disabilities, making it possible for multi-modal wireless browsers with limited display capabilities (e.g., Web-enabled pagers and phones) to handle tables.
When you press Enter after the first paragraph in a table cell, a paragraph <p> tag is added inside each <th> tag in that cell.
- thead This tag lets you modify a header row in a table. When a table requires multiple pages in output, the header row is repeated by default at the top of each page. Each <thead> tag must have at least one <tr> tag within it, which is used to represent a single row.
- tr This tag lets you modify single rows that are contained within <tbody>, <tfoot>, and <thead> tags. This tag can be used for setting page breaks on table rows. See Setting Page Breaks for Table Rows.
For more about each of these tags, please refer to http://www.w3c.org.
- From the Show Properties drop-down list
on the upper-right side of the editor, select Show: Assorted Relevant Properties. The most relevant properties for that style are shown on the right side of the editor.
-
In the Properties section, you can click the plus button
next to a property group (if necessary) to expand the group. Click in the field to the right of a property to change its setting.
Most of the relevant properties are the same as those used for regular paragraph formatting. For details and steps for setting those properties, see About Paragraph Formatting.
For the <td> and <th> styles, you also might want to adjust the vertical alignment of text (e.g., top, middle, bottom). You can do this by expanding the Cell property group and setting the vertical-align property.
- Press CTRL+S or click
to save your work.
Note: When you insert a table, it is set up by default to use standard HTML table tags in the individual cells (e.g., <th> for table headers, <td> for regular table text). However, you may prefer to use paragraph <p> tags in the table cells instead. Either way, you can determine the styles by selecting the table cells, clicking Table>Cell Content Style, and choosing the style to be used for those cells. See Selecting Styles for Table Cell Contents.
Note: In addition to using styles in a topic style sheet, you can also use custom table style sheets to modify the look and feel of multiple tables at once. These table style sheets let you easily and quickly create patterns and different looks for tables. See How to edit styles in a table style sheet.
See Also
Open topic with navigation