jQuery DataTables 最大列宽 [英] jQuery DataTables max column width
问题描述
我在我的 .NET Web 应用程序中使用 jQuery DataTables,但是如何为一个特定列设置最大宽度,所有其他列都应该自动调整大小(就像它们现在在我的表格中一样)
I'm using jQuery DataTables in my .NET web application but how do I set a max width for one specific column, all the other columns should be auto sized (like they are now in my table)
编辑
DataTables 自己做对了,问题是有一个很长的词没有空格导致问题
The DataTables did it correctly by itself, the problem was there was a very long word without spaces that cause the problem
推荐答案
您的问题似乎与 CSS 更相关...
Your problem seems more CSS related ...
在 CSS 中使用 word-wrap 可以解决这个问题,对于 columnX 只需将其添加到您的 CSS 中即可.
Using word-wrap in CSS would fix that issue, for columnX just add this to your CSS.
.columnX {
word-wrap: break-word;
}
它会根据您为列设置的宽度来包装甚至没有空格的单词.
It would wrap even words without spaces based on your set width for the column.
参见:https://developer.mozilla.org/en/css/word-换行
这篇关于jQuery DataTables 最大列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!