MyBB Community Forums

Full Version: Long usernames widen the column
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Some of my users have long usernames, so in their posts the username column appears wider than that of other posts to fit the username. How to line up so that the username column is of the same width for every post, either that all columns align by the longest username, or that the font of the long usernames scales down to fit (don't know if that would look good, though)? (I can add a screenshot if it's not clear what I'm saying)
You can just shorten the max length of usernames in User Profile & Registration settings.
I could shorten it for new users, but I have existing members with long usernames.
You could politely request that the send you a shorter name to change theirs to. Also say that if they don't do it soon enough it will be changed to something else. Make changing their name sound like a good thing, but also give them deadlines.
There will be a way that you can sort out the classic layout to be the same no matter what the username length, but that is not my speciality.
Wrap username variable (in postbit_classic template) with a span tag (eg <span class="post_username">{$post['profilelink']} </span>) and in your golobal.css add
.post_username { 
display:inline-block;
max-width:40px;
 word-wrap: break-word; /*CSS3*/
-ms-word-break: break-all; /* The -ms-word-break attribute is an extension to CSS, and can be used as a synonym for word-break in IE8 Standards mode.*/
 white-space: pre-wrap;
 word-break: break-all;
}

Change max-width according to your column where username is located (eg table cell on left side of postbit).
The span tag was there already.
I added the code and tried different numbers for max-width but it didn't change anything.
Could you post a forum URL?
(2013-03-25, 12:31 PM)padagrad Wrote: [ -> ]The span tag was there already.
I added the code and tried different numbers for max-width but it didn't change anything.

Did you add that class to that span tag (class="largetext post_username") ? On my localhost setup everything is working fine.
No. Because you wrote:
(2013-03-25, 11:27 AM)Johnny S Wrote: [ -> ]Wrap username variable (in postbit_classic template) with a span tag (eg <span class="post_username">{$post['profilelink']} </span>)
and "e.g." stands for "for example", so I thought it didn't matter what the class exactly was. Wink

It's still not working.
(2013-03-25, 12:32 PM)JordanMussi Wrote: [ -> ]Could you post a forum URL?
Pages: 1 2