Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 4 Material 2 - Center Tab Components

I couldn't find out how to center the Angular Material Tab Component.

Can be seen here: https://material.angular.io/components/tabs/overview

I think there even is a way of doing it included, it is just very unclear what to do imo.

Below is a screenshot of the docs. What's meant by properties? Is it in html or does it need to be set in the typescript ?

I would really appreciate your help.

like image 720
Cryptic Pug Avatar asked Jul 22 '17 15:07

Cryptic Pug


2 Answers

Looks like what you're looking for is the md-stretch-tabs attribute, which should be applied on <md-tab-group>:

<md-tab-group md-stretch-tabs>
    <md-tab label="Tab 1">
        <p>Content for tab 1.</p>
    </md-tab>
    <md-tab label="Tab 2">
        <p>Content for tab 2.</p>
    </md-tab>
    ...
</md-tab-group>

Plunker

like image 88
Edric Avatar answered Oct 08 '22 00:10

Edric


This is an internal call that is not supposed to be exposed. An issue an pull request to fix this have been made, but you will not be able to use this API call.

Check this issue on github for updates.

Sorry this isn't the answer you were looking for.

like image 25
Z. Bagley Avatar answered Oct 07 '22 23:10

Z. Bagley