admin管理员组文章数量:1279246
I am following this link for tabs in my webpage.
This is code for tabs.
<div ng-cloak>
<md-content>
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="one">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="two">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="three">
<md-content class="md-padding">
<p> Tab 3 contents</p>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</div>
The above code displays tabs heading in left of HTML page
How to display tabs heading in center of HTML page?
I have one more requirement. There is a button in tab1 contents. on clicking of that button how to move to second tab?
I am following this link for tabs in my webpage.
https://material.angularjs/latest/demo/tabs
This is code for tabs.
<div ng-cloak>
<md-content>
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="one">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="two">
<md-content class="md-padding">
<p> Tab 2 contents</p>
</md-content>
</md-tab>
<md-tab label="three">
<md-content class="md-padding">
<p> Tab 3 contents</p>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</div>
The above code displays tabs heading in left of HTML page
How to display tabs heading in center of HTML page?
I have one more requirement. There is a button in tab1 contents. on clicking of that button how to move to second tab?
Share Improve this question asked Feb 29, 2016 at 9:22 Devesh AgrawalDevesh Agrawal 9,21218 gold badges86 silver badges134 bronze badges 02 Answers
Reset to default 8md-center-tabs="true" worked for me
<md-tabs md-center-tabs="true" md-dynamic-height md-border-bottom class="md-primary" style="border: none;">
You can use Following link to align centre/left/bottom etc the Heading/any elements
https://material.angularjs/latest/layout/alignment
Ex:- layout="row" layout-align="center center"
For making tabs as Wizard
Controller Logic :-
$scope.max = 2; // max you can put your number
$scope.selectedIndex = 0;
$scope.nextTab = function() {
var index = ($scope.selectedIndex == $scope.max) ? 0 : $scope.selectedIndex + 1;
$scope.selectedIndex = index;
};
Html :-
<md-tabs md-dynamic-height="" md-border-bottom="" md-selected="selectedIndex" md-center-tabs="true">
.....
</md-tabs>
Plunker In Action :-
http://plnkr.co/edit/rOh0Yy?p=preview
本文标签: javascriptHow to display tabs heading center aligned in angularjs material designStack Overflow
版权声明:本文标题:javascript - How to display tabs heading center aligned in angularjs material design - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741219144a2360629.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论