Closed ChrCoello closed 9 months ago
It's a very common CSS pitfall: text-align: center
only centers the text inside the table cells. To center the table itself within its container (slide), you can use the following CSS:
<style scoped>
table {
max-width: fit-content;
margin-left: auto;
margin-right: auto;
}
</style>
The following article is very useful for all about centering with CSS: How To Center a Div (https://www.joshwcomeau.com/css/center-a-div/)
It's a very common CSS pitfall:
text-align: center
only centers the text inside the table cells. To center the table itself within its container (slide), you can use the following CSS:<style scoped> table { max-width: fit-content; margin-left: auto; margin-right: auto; } </style>
The following article is very useful for all about centering with CSS: How To Center a Div (https://www.joshwcomeau.com/css/center-a-div/)
Thanks alot for your prompt answer and the links. And for marp!!
I just would like to center a table in the middle of a slide. I tried
but without success. Thanks in advance