Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Users list columns with same width

  • axaler
  • axaler
  • OFFLINE
  • Posts: 31
  • Thanks: 7
  • Karma: 2
11 years 4 months ago - 11 years 4 months ago #228805 by axaler
I made a users list with 4 columns.
In front end the list shows the users and each user has columns with different width (see image) depending on the content of the fields in the column.
We would like the columns in each user would have the same width of 25% each.
Can we do it with css or changing the code in the list?
If so, can you tell me which css to change or add or what line of code to change or add and in which file?
Thanks
PS. I'm using Joomla! 2.5.11 and the latest version of CB

Attachments:
Last edit: 11 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #228831 by krileon
Replied by krileon on topic Users list columns with same width

Can we do it with css

Absolutely. Below is the CSS required to do this. Simply add to the bottom of your Joomla template CSS file and should set all columns to 25% as desired.

Code:
.cbUsersList .cbUserListTable .sectiontableheader > th, .cbUsersList .cbUserListCol1, .cbUsersList .cbUserListCol2, .cbUsersList .cbUserListCol3, .cbUsersList .cbUserListCol4 { width: 25%; }

I also suggest either using Chrome or Firebug for Firefox and right clicking then clicking inspect to see an elements CSS in the future so you can see what classes/IDs you need to style an element.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • axaler
  • axaler
  • OFFLINE
  • Posts: 31
  • Thanks: 7
  • Karma: 2
11 years 4 months ago - 11 years 4 months ago #228843 by axaler
Replied by axaler on topic Users list columns with same width
Thanks for the reply. I had already tried this and it does not work.
The columns become 25% each, but continue to be different for each user, because the width of the container of the columns changes for each user, based on the content of the fields.
In fact, for a user 25% gives 171px and in the subsequent it gives 164px (see image with Firebug).
Is there a way to adjust the container of the columns at 100%? (Being the bootstrap template I believe it should not have a measure in px)
Note that, putting the code suggested, the 4 columns do not occupy the entire width of the content as it was before (see image previous post), but only a part, variable for each user.
Thank you for a new answer.

Attachments:
Last edit: 11 years 4 months ago by axaler.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #228848 by krileon
Replied by krileon on topic Users list columns with same width
It works fine, there are certain elements that won't allow width to be enforced. For example Table elements don't care about its parent width if the table has width forced on it. You may also need to force word wrapping to prevent text from pushing the width (e.g. word-wrap: break-word;).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • axaler
  • axaler
  • OFFLINE
  • Posts: 31
  • Thanks: 7
  • Karma: 2
11 years 4 months ago #228850 by axaler
Replied by axaler on topic Users list columns with same width
It may be that it works fine, but does not give me the solution I was looking for and for which I had asked for help.
The elements of the table I think are table, tr and td.
Can you tell me if there is a css to adjust these items so that the table is 100% of the content, tr is of course 100% of the table, and td 25% of the tr/table?
thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago - 11 years 4 months ago #228860 by krileon
Replied by krileon on topic Users list columns with same width
You can not force them to be perfectly 25%. 25% is a relative width. It'll make padding/margin adjustments as needed. You're not going to get the desired results without using exact pixel widths, which won't allow overages (anything going outside the width would be overflow). I also can not help with specific CSS issues through images, you need to provide a URL to your userlist (you may PM this URL if you'd like it kept private) so the CSS can be tested directly on your site. The alternative to force 25% is to use word-wrap as mentioned in my previous reply unless an element is causing the width to be bumped (probably due to your UL > LI elements).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 11 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum