DataTablesSrc icon indicating copy to clipboard operation
DataTablesSrc copied to clipboard

Layout option behaving differently than stated in documentation? (stacking vs. side by side)

Open Seltonu opened this issue 1 year ago • 1 comments

Unsure if this is truly a bug / documentation error, but when using the layout property to set a custom top layout the items seem to stack rather than go side by side.

The documentation for layout states the following for passing an array (emphasis mine)

array - An array of any of the above options, providing the ability to show multiple items next to each other.

However when I try this, the behavior I get has elements stacking rather than side by side. I believe this to be an error, because per the documentation stacking would be achieved by using top2End... topNEnd

I have created a simple JSFiddle to show the issue, where I believe we would expect the custom tool bar, pageLength, and search to all be on the same horizontal alignment rather than stacked.

https://jsfiddle.net/tf8nepLj/8/

image

Seltonu avatar Apr 09 '24 01:04 Seltonu

Right, what the documentation means is that they are next to each other in the DOM. Apologies for the confusion - you aren't the only one to wonder about this.

I'm going to make a chance for DataTables 2.1 to have them actually display next to each other. Until then, a little CSS as described here could be used to get the layout you are looking for.

I don't expect 2.1 to be too far away - perhaps a month or so.

AllanJard avatar Apr 11 '24 09:04 AllanJard

@AllanJard confirming that this now behaves as expected in 2.1.4, thank you!

Seltonu avatar Aug 26 '24 22:08 Seltonu