How to middle-align cells with list-table extension? #13979
Replies: 4 comments 3 replies
-
|
Thanks for the reproducible example.
Important Accessibility: To improve accessibility, please add alternative text to your screenshots. This helps all users, including those using screen readers, to understand the context of the images. A brief description can make a big difference! See Good Alt Text, Bad Alt Text — Making Your Content Perceivable. |
Beta Was this translation helpful? Give feedback.
-
|
In Reveal.js, You can use your favourite browser inspect mode to investigate the structure of your HTML to see all this. You could use a CSS rule to get a somewhat better visual, I tend to use the following. ---
title: "MRE with the 'list-table' extension"
format:
revealjs:
include-in-header:
- text: |
<style>
.reveal table td {
vertical-align: middle;
div.quarto-figure {
margin-bottom: 0;
margin-top: auto;
margin-bottom: auto;
}
figure {
margin: 0;
}
}
</style>
---
## Slide
::: {.list-table header-rows=1}
* - Figure
- Some text
* - test Column 1 text
- test Column 2 text
* - 
- This text is bottom-aligned
* - {width="40%"}
- It doesn't look too good with a small image and a longer text
::: |
Beta Was this translation helpful? Give feedback.
-
|
@mcanouil can you confirm that I do not need to have the I removed the extension and when I try to use the code you provide, it doesn't show as a table:
|
Beta Was this translation helpful? Give feedback.
-
|
Fair enough. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
With the
list-tableextension, when I use images and text on the same row, they look misaligned: text is bottom-aligned but the figure seems to be top-aligned.Is there any way to center vertically the elements (both text and figure)?
So far I found the code I need is
vertical-align: middlebut I'm not sure exactly where to pass this in the QMD file. I tried withand
but it doesn't work.
Here's a reproducible example and the rendered version:
Beta Was this translation helpful? Give feedback.
All reactions