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

官网表格如何实现 #387

Closed
MemoryBen opened this issue Aug 19, 2018 · 2 comments
Closed

官网表格如何实现 #387

MemoryBen opened this issue Aug 19, 2018 · 2 comments
Labels
√Solved 已解决

Comments

@MemoryBen
Copy link

我翻遍手册,只找到这个
https://datatables.net/examples/api/row_details.html
然而这个并不是将多出来的列进行隐藏
求大神解答

@guoqiang998
Copy link

columnDefs = [ {
"targets" : 0,
"visible" : false
} ... ];

另外页面记得隐藏的列也需要加上对应的<th></th>

@ssy341
Copy link
Owner

ssy341 commented Mar 7, 2019

官方页面首页的例子使用responsive插件,初始化代码如下

		$(document).ready( function () {
			$('#example')
				.addClass( 'nowrap' )
				.dataTable( {
					responsive: true,
					columnDefs: [
						{ targets: [-1, -3], className: 'dt-body-right' }
					]
				} );
		} );	

@ssy341 ssy341 added the √Solved 已解决 label Mar 7, 2019
@ssy341 ssy341 closed this as completed Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
√Solved 已解决
Projects
None yet
Development

No branches or pull requests

3 participants