Как закрепить шапку таблицы в confluence

Tables

Confluence tables allow you to present important information and discuss it with your team. Use familiar table formatting options –resizing columns, coloring cells, rows and columns, and sorting the table by clicking the column headers – to view the information the way you like it.

Using Confluence Cloud? Check out our info on the new Confluence Cloud editor if your table looks like this one.

Screenshot of a table as it appears in the Confluence Cloud editor. It has three columns and three rows.

Insert a table

To create a table:

  1. Hit the Table button in the toolbar
  2. Click a cell in the drop-down to set the number of columns and rows in your table

Screenshot of the Tables drop down menu showing a 3 by 3 table

On this page:

Related pages:

Edit your table

To resize table columns, just click and drag the column’s border. To make other changes to your table, click inside it to reveal the table toolbar.

Here’s a summary of the table tools:

Screenshot of a dropdown menu in the Table toolbar showing the options Responsive and Fixed width.

Column width modes

  • Responsive – choose this mode if you want the table to expand as you add content. You can drag to resize the columns. It’ll also resize itself to fit the page-viewer’s window size (within reason).
  • Fixed width – choose this mode if you want to drag column borders to set width. Columns appear at your set size, regardless of content and window size.

Rows

  • Insert rows before or after the current row
  • Delete the current row
  • Cut, copy and paste the current row
  • Mark a row as a header row (shaded with bold text)

Columns

  • Insert columns before or after the current column
  • Delete the current column
  • Cut, copy and paste the current column
  • Mark a column as a header column (shaded with bold text)
  • Add a numbering column to automatically number each row

Cells

  • Merge selected cells
  • Split selected cells
  • Change cell color

Table

  • Delete entire table

Shortcut keys

Copy the current table row, or the selected rows.

Insert a table. (Opens the Insert Table dialog.)

Paste the table rows from your clipboard, placing them above the current row.

Cut the current table row, or the selected rows.

For more editor keyboard shortcuts, see Keyboard shortcuts.

Sort the table in view mode

When viewing a table on a page, you can sort it by clicking the sort icons in the header row.

Screenshot: A colorful, sortable table


The default sort order is the order the table rows are listed in the editor. You can use the Cut row and Paste row icons to move rows around in the editor.

Sticky table headers in view mode

In some instances the header rows of your table will stick to the top when you’re scrolling down a page, making those really long tables easier to read.

You don’t need to do anything to enable sticky table headers, however there are a lot of situations where headers won’t stick. These include when your table:

  • Is inside a page layout, inside another table, or inside a macro.
  • Has no header row or there are cells in the top row that aren’t marked as headers.
  • Has a header column, instead of a header row, and scrolls horizontally.
  • Contains another table, that has its own header row.

There’s no way to freeze rows or columns in Confluence tables.

See CONFSERVER-54343 — Getting issue details. STATUS for issues with sticky table headers.

Using Tables

Confluence tables allow you to present important information and discuss it with your team. Use familiar table formatting options –resizing columns, coloring cells, rows and columns, and sorting the table by clicking the column headers – to view the information the way you like it.

Insert a table

To create a table:

  1. Hit the Table button in the toolbar
  2. Click a cell in the drop-down to set the number of columns and rows in your table

Screenshot: Insert a table with 3 rows and 3 columns

Search Confluence Documentation

On this page:

Edit your table

To resize table columns, just click and drag the column’s border. To make other changes to your table, click inside it to reveal the table toolbar.

Here’s a summary of the table tools:

Column width modes

  • Responsive – The table will expand as you add content, and you can drag to resize the columns. It’ll also resize itself to fit the page-viewer’s window size (within reason).
  • Fixed width – Drag column borders to set width. Columns appear at your set size, regardless of content and window size.

Rows

  • Insert rows before or after the current row
  • Delete the current row
  • Cut, copy and paste the current row
  • Mark a row as a header row (shaded with bold text)

Columns

  • Insert columns before or after the current column
  • Delete the current column
  • Cut, copy and paste the current column
  • Mark a column as a header column (shaded with bold text)

Cells

  • Merge selected cells
  • Split selected cells
  • Change cell color

Table

  • Delete table
  • Add a numbering column to automatically number each row

Shortcut keys

Copy the current table row, or the selected rows.

Insert a table. (Opens the Insert Table dialog.)

Paste the table rows from your clipboard, placing them above the current row.

Cut the current table row, or the selected rows.

For more editor keyboard shortcuts, see Keyboard shortcuts.

Sort the table in view mode

When viewing a table on a page, you can sort it by clicking the sort icons in the header row.

Screenshot: A colorful, sortable table

Sticky table headers in view mode

In some instances table header rows will stick to the top when you’re viewing a page, making those really long tables easier to read. There are a few exceptions, though. Table headers aren’t sticky when your table:

Как создать вертикальные заголовки таблицы в конфу

Есть ли способ создать вертикальные заголовки таблиц в месте слияния?

Я также не могу найти кнопку редактирования HTML — я был уверен, что вы можете редактировать HTML за один этап.

6 ответов 6

Вот тебе начало .

Оберните нужную таблицу пользовательским макросом rotate-headers .

Он производит что-то похожее на это:поворотные заголовки таблиц

Возможно, вам придется несколько изменить CSS, но это хорошее начало.

если вы измените последний код на .rotate-headers th > div px) rotate(270deg); width: $px; > Вы также можете добавить @username в шапку

Это очень незначительное изменение в ответе Тони Эббота.

Кажется, Atlassian изменил контейнер внутри своего <th> с div на <p>. Я также сделал небольшую настройку, чтобы повернуть только заголовки столбцов с помощью селектора tr:first-parent.

Создайте пользовательский макрос, перейдя в Администрирование Confluence -> Конфигурация -> Пользовательские макросы. Вставьте макрос в свою страницу и создайте таблицы внутри макроса.

Вдохновленный макросом Дэвида Симпсона, но с этим CSS ширина столбца больше не равна ширине (не повернутого) текста заголовка, что сводит на нет экономию пространства при использовании вертикального текста.

Когда я впервые попробовал этот макрос, я дал ему неправильные параметры (ширина> высота) и удивился, почему исчезли заголовки. Вы можете попытаться вычислить высоту в зависимости от $ body (не идеально, так как не все буквы 1em, но в качестве отправной точки)

Я попробовал интерпретации dvdsmpsn ответа ТониАббота и Джоша, но оба не дали желаемого результата. Я думаю, что это может быть связано с обновлением в Confluence до 6.1.1 (версия, которую я использую). Решение TonyAbbot выравнивает текст в соответствии с шириной, но не меняет ширину столбца, а решение Джоша не поворачивает заголовки по вертикали (опять же, это может быть связано с обновлением в Confluence)

Вместо этого я пришел к своему собственному решению, используя ответы dvdsmpsn и TonyAbbot:

Также как примечание: не забудьте выбрать «Rendered» при создании пользовательского макроса в Confluence.

Как зафиксировать заголовок таблицы при прокрутке?

Есть таблица в контейнере с жёстко заданной высотой. При большом количестве строк в таблице у окружающего блока появляется полоса прокрутки. Однако имеется проблема — заголовок таблицы уезжает наверх, и его не видно. Как зафиксировать его, чтобы он всегда был виден наверху блока?

Я пытался назначить ему вот такие CSS свойства, но видимого результата нет.

Какие есть способы решения проблемы? Желательно обойтись без разбиения таблицы не две, т.к. в таком случае могут разойтись столбцы.

Для удобства вот пример моей вёрстки.

К сожалению, сейчас position: sticky практически нигде не поддерживается, поэтому данный ответ не очень полезный 🙁

Судя по этому ответу на enSO из-за бага в Chrome, свойство position: sticky нужно присваивать не заголовку таблицы ( thead ), а ячейкам этого заголовка ( th ). Ну и ещё стоит добавить к ним белый фон. Примерно так:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *