如何在 React Virtualized 的网格中将 scrollToColumn 居中?

How can I center the scrollToColumn in React Virtualized's Grid?

scrollToColumn 将保证网格的列可见。如何渲染它以使其在网格中居中?

您可以使用 scrollToAlignment 属性:

Controls the alignment scrolled-to-rows. The default ("auto") scrolls the least amount possible to ensure that the specified row is fully visible. Use "start" to always align rows to the top of the list and "end" to align them bottom. Use "center" to align them in the middle of container.

假设您使用的是 7.1.2+ 版本,属性 将受支持。