Hi,
I am using DataTables from DataTables in TabStrip.
I figure i faced the same problem as mentioned here: datatable jquery - table header width not aligned with body width
There was a solution mentioned in the blog that works for Bootstrap Tab:
// If table is in the tab, you need to adjust headers when tab becomes visible.
// For example, for Bootstrap Tab plugin:
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e){
$($.fn.dataTable.tables(true)).DataTable().columns.adjust();});
How can i do that for telerik TabStrip?
Here is my TabStrip in cshtml:
<
div
class
=
"col-md-9 k-content wide"
>
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Animation(animation =>
animation.Open(effect =>
effect.Fade(FadeDirection.In)))
.Items(tabstrip =>
{
tabstrip.Add().Text("OEE")
.Selected(true)
.Content(@<
text
>
</
text
>);
tabstrip.Add().Text("System Performance")
.Content(@<
text
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-5"
>
<
table
id
=
"systemPerfTable"
class
=
"table table-striped table-bordered"
cellspacing
=
"0"
>
<
thead
>
<
tr
>
<
th
>Item</
th
>
<
th
>Value</
th
>
</
tr
>
</
thead
>
<
tbody
>
<
tr
>
<
th
scope
=
"row"
>Lot Elapsed Timestamp</
th
>
<
td
id
=
"lotElapsedTimestamp"
>1/1/1900 00:00:00</
td
>
</
tr
>
<
tr
>
<
th
scope
=
"row"
>Lot Submission Timestamp</
th
>
<
td
id
=
"lotSubmissionTimestamp"
>1/1/1900 00:00:00</
td
>
</
tr
>
</
tbody
>
</
table
>
</
div
>
</
div
>
</
div
>
</
text
>);
})
)
</
div
>
Here is the script:
<
script
>
$("#systemPerfTable").DataTable({
scrollY: "500px",
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
info: false
});
</
script
>