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

Set the default column maximum width on the table #10136

Closed
Achuan-2 opened this issue Jan 10, 2024 · 2 comments
Closed

Set the default column maximum width on the table #10136

Achuan-2 opened this issue Jan 10, 2024 · 2 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

In what scenarios do you need this feature?

现在思源笔记的表格有一个问题,直接往表格里粘贴长文本,表格的宽度默认会被拉的很长,想再拖回适当宽度很费劲
思源表格默认粘贴长文本会有问题

Describe the optimal solution

我发现表格添加word-wrap和列max-width就能解决这个问题,并且max-width这个值只是影响粘贴文字时的最大列宽度,默认的表格宽度依然是60px,也依然可以调整表格的列宽度

/* 表格文字换行 */
.protyle-wysiwyg div.table[data-node-id] table {
    word-wrap: break-word;
}
/* 设置表格每列默认宽度 */
.protyle-wysiwyg div.table[data-node-id] table tr td{
    max-width: 400px; 
}

思源表格添加文本换行和设置表格列最大宽度

Describe the candidate solution

none

Other information

No response

@Vanessa219 Vanessa219 self-assigned this Jan 10, 2024
@Vanessa219 Vanessa219 added this to the 2.12.3 milestone Jan 10, 2024
Vanessa219 added a commit that referenced this issue Jan 10, 2024
@Vanessa219 Vanessa219 changed the title 表格优化:添加word-wrap和列max-width Set the default column maximum width on the table Jan 10, 2024
@Vanessa219
Copy link
Member

如果列少的话 max-width 设置为 620 可能比较好一点。

@Achuan-2
Copy link
Member Author

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants