Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images cannot be resized within a Table #141

Open
tabedzki opened this issue Oct 9, 2022 · 4 comments
Open

Images cannot be resized within a Table #141

tabedzki opened this issue Oct 9, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@tabedzki
Copy link

tabedzki commented Oct 9, 2022

Describe the bug
A clear and concise description of what the bug is. I believe this arises from the table reading the | symbol which is used to denote the image wiidth. I've tried versions where the | is in a ! [[ ]] format as well as the ![ ]( ) syntax. Both do not yield what the Obsidian preview yields.

Samples to Reproduce
Paste the following into a markdown file.
I'm using the Obsidian 0.15.9

Example Table:

Example
 
| Bottlebrush | Parameters                                                                                                        | Image | 
| ----------- | ----------------------------------------------------------------------------------------------------------------- | ----- | 
| ![\| 100](https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1200px-Wikipedia-logo-v2.svg.png) | test  | text |
| test        | ![\|10](https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1200px-Wikipedia-logo-v2.svg.png)       |       | 
| test        | ![\|100](https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1200px-Wikipedia-logo-v2.svg.png)       | ![\|100](Pasted_image_20220804220818.png)      | 

Expected behavior
To have the table either resize the content natively to have everything fit on the slide or to use the requested pixel size to resize the images.

@tabedzki tabedzki added the bug Something isn't working label Oct 9, 2022
@tabedzki
Copy link
Author

tabedzki commented Oct 9, 2022

Semi-related, there a way to have the table or content automatically fit? I don't know CSS at all and was hoping for something with Obsidian that would work out of the box for content rescaling.

@fnumatic
Copy link
Contributor

Resizing images inside table cells is not that easy. By default <td> </td> should grow with the size of the content.
Regarding your example:

## Example

| Bottlebrush | Parameters                        | Image |
| ----------- | --------------------------------- | ----- |
| test        | ![](https://tinyurl.com/44p5tkwr) | test  |
| test        | ![](https://tinyurl.com/44p5tkwr) |       |
| test        | ![](https://tinyurl.com/44p5tkwr) |       |

This styling can somewhat help.

<style>
.reveal td{
  position: relative;
}
.reveal td img{
  position: absolute;
  top: 0;
}
</style>

screenshot css img table

@MSzturc
Copy link
Owner

MSzturc commented Oct 22, 2022

Yeah, by default revealjs doesn't optimize layouting of tables, currently advanced slides doesn't modify the rendering of table. This will be a big change. I find it a pity that markdown spec has no syntax to describe table column & row properties. I will have a look at this topic when things get a little quieter in my daily job.

@tabedzki
Copy link
Author

tabedzki commented Nov 7, 2022

Ahh ok thanks; this isn't a high priority request from my end since I figured out a solution for the presentation I wanted to do.
I'm surprised that the Markdown standard itself doesn't implement something like this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants