Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8400803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:38:49+00:00 2026-06-09T21:38:49+00:00

This is my situation : I’m currently in the process of finalizing a rather…

  • 0

This is my situation :

  • I’m currently in the process of finalizing a rather… huge web application (PHP with CodeIgniter, MySQL, Javascript+Ajax+Jquery and using various Javascript libraries – e.g. dataTables)

The issue :

  • Let’s say we’ve got a table, fixed-width.
  • The first column is also fixed-width. (Let’s say at 200px)
  • When the table is populated :
    • If the contents of the first column occupy less than 200px space, it’s ok.
    • If the contents exceed those 200px then the content is wrapped, thus creating a “double line” effect and higher rows than I’d wished.

Hint :

  • “Shrinking” a very very very long line to something like very very very ... is what I’m thinking. Is something like that even possible? Server-side?

How would you approach that? (preferably in an elegant way – ‘coz, yep, I admit that I have a few solutions in mind, none of which seems… user-friendly… lol)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:38:50+00:00Added an answer on June 9, 2026 at 9:38 pm

    I think doing a string-truncation is impossible serverside, if you are not using a monospace font so that the same number of characters always has the same width. What you could do is a client-side string-truncation:

    (Nice code at Calculate text width with JavaScript):

    CSS:

    #testing-div
    {
        position: absolute;
        visibility: hidden;
        height: auto;
        width: auto;
    }
    

    JS:

    var test = document.getElementById("testing-div");
    test.style.fontSize = fontSize;
    var height = (test.clientHeight + 1) + "px";
    var width = (test.clientWidth + 1) + "px";
    

    You can loop through the entire length of the string, and keep adding a character to the body of #testing-div, calculating the width, and checking if it fits. Make sure you add the ... if the string is too long.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this situation: There's a critical VB6 desktop application running on a production box.
I have this situation: MySQL - Newbie question: Which are the PK and the
This situation arises from someone wanting to create their own pages in their web
Consider this situation: on a multi-monitor system, an application was maximized, then minimized, in
In this situation I have two models, Comment and Score. The relationship is defined
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
I have this situation: http://jsfiddle.net/bRDgK/3/ In this situation I have a modal dialog with
I came across this situation while migrating our DB from Foxpro to SQL. Below
I have this situation: { float foo[10]; for (int i = 0; i <
I have this situation where I want to display a list of Administration objects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.