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

Is there any way to resize columns width based on the element text length inside the columns or resize Column to fit it's contents? #271

Open
ThirupathiGovind opened this issue Mar 1, 2018 · 3 comments

Comments

@ThirupathiGovind
Copy link

Briefly ( tweet size ) describe your issue and how you discovered it.

...

Expected behavior

...

Actual behavior

...

Steps to reproduce behavior

  • OS:
  • Browser:
  • code/fiddle/pen url:
@ThirupathiGovind ThirupathiGovind changed the title Is there is any way to resize columns size depends on the elements inside the columns ? Is there any way to resize columns size depends on the elements inside the columns or resize Column to fit it's contents? Mar 1, 2018
@effone
Copy link

effone commented Mar 1, 2018

Auto column width is what you are looking for if I am getting your problem right ...

<div class="row">
    <div class="col-xs">
        Content ...
    </div>
</div>

@ThirupathiGovind
Copy link
Author

@effone yes, it works. But it makes all columns equal size. I want to auto resize column width based on the text length.

In my case, I have 7 columns. Each column has text with different size. I want that bigger text column should take larger size than the small text.

@ThirupathiGovind ThirupathiGovind changed the title Is there any way to resize columns size depends on the elements inside the columns or resize Column to fit it's contents? Is there any way to resize columns size depends on the element text size inside the columns or resize Column to fit it's contents? Mar 1, 2018
@ThirupathiGovind ThirupathiGovind changed the title Is there any way to resize columns size depends on the element text size inside the columns or resize Column to fit it's contents? Is there any way to resize columns width depends on the element text size inside the columns or resize Column to fit it's contents? Mar 1, 2018
@ThirupathiGovind ThirupathiGovind changed the title Is there any way to resize columns width depends on the element text size inside the columns or resize Column to fit it's contents? Is there any way to resize columns width based on the element text length inside the columns or resize Column to fit it's contents? Mar 1, 2018
@effone
Copy link

effone commented Mar 1, 2018

Well you can define a column to fixed width or max width and the other's width as flexible (thats how sidebars work). Here is a pen for example.

If all the column width are auto and non-fixed generally it will be distributed equally unless content on any one forces to maintain minimum size (you can check this reducing the size of viewport). It sounds weird but it happens. Look at the following image; the menu items are actually auto width columns and if you notice they are not equal in reduced size viewport because of their content (unless any word break or wrap is applied).

menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants