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

  • Home
  • SEARCH
  • 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 7699623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:31:21+00:00 2026-05-31T22:31:21+00:00

Using a data table from http://datatables.net/ , How can i stop it from overflowing

  • 0

Using a data table from http://datatables.net/ , How can i stop it from overflowing on the page?
enter image description here

EDIT:

<script type="text/javascript">
$(document).ready(function() {    
   $('#comment').dataTable( {
    "oLanguage": {
      "sInfo": "",
      "sInfoEmpty": "",
      "sInfoFiltered": ""
    },
    "sPaginationType": "full_numbers",
    "iDisplayLength": 5,
    "bLengthChange": false,
    "aaSorting": [[3, 'desc']],
    "aoColumns": [ 
      { "bSortable": false },
      null,
      null,
      { "asSorting": [ "desc" ] },
      null,
      { "bSortable": false }
    ] } );
});
</script>


<table id="comment">
      <thead>
      <tr>
        <th></th>
        <th>Name</th>
        <th>Comment</th>
        <th>Created</th>
        <th>Attachments</th>
        <th><center>Delete?</center></th>
      </tr>
    </thead>
    <tbody>
    <% @company.comments.each do |comment| %>
    <tr>
      <td>
      <% if comment.user.avatar.blank? %>
      <%= image_tag("default_user.png", :height => "50", :width => "50") %>
      <% else %>
      <%= image_tag(comment.user.avatar_url, :height => "50", :width => "50") %>
      <% end %>
      </td>
      <% if comment.user.name.nil? %>
      <td><%= comment.user.email %></td>
      <% else %>
      <td><%= comment.user.name %></td>
      <% end %>
      <td><%=raw comment.body %></td>
      <td><%= comment.created_at.to_s(:db) %></td>
      <% if comment.file.blank? %>
      <td></td>
      <% else %>
      <td><%= link_to comment.file_identifier, comment.file_url %></td>
      <% end %>
      <td><center><%= link_to image_tag("delete.png", :alt => "Delete", :height => "15px"), [comment.company, comment], :confirm => 'Are you sure?', :method => :delete %></center></td>
    </tr>
  <% end %>
  </tbody>
  </table>
  • 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-05-31T22:31:22+00:00Added an answer on May 31, 2026 at 10:31 pm

    The DataTables function won’t help with trouble-shooting. It’s a CSS issue. And also a content issue. First the content:

    Sizing on tables is “fuzzy”; the table will do its best to size to your suggestions, and will exactly match your suggestions when it can. When you have a huge long string, though (I believe I’m seeing a whole long series of A’s and D’s, right?) it has no choice. It will make the column as wide as it needs to be to fit the content. The other columns will then be as narrow as they can be and still accomodate your content.

    The solution? CSS. It boils down to overflow: hidden. In your stylesheet, set your TD elements to use overflow: hidden and the string will get “chopped off”. This isn’t always visually pleasing, but sometimes web development is about compromise.

    One of those compromises is to also set text-overflow: ellipsis. Any text that can’t fit into the cell will be truncated and the ellipsis symbol (three tightly-kerned dots; it’s a single character, not three actual dots) will be inserted at the end where it gets cut off.

    But then how do you see the data in its entirety? Tricky one. I’ve just been running a script in the fnRowCallback callback that sets the title of the cell to be the same as its contents. Then on mouseover, a tooltip shows you the content. I’m sure there are better ways.

    In the end, what you need to ask is: is a super-long string like that even realistic? What’s the expected content?

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

Sidebar

Related Questions

I have a script that I am using to copy data from a table
I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text
I am using datatables. ( http://datatables.net/ ) I have created a table. There is
Using: ado.net How can I select data from a DataTable using SQL with an
I'm using DataTables plugin from http://datatables.net . The plugin it self is very useful,but
I am pulling data from one table, called analyzedCopy, and using it to over-rite
using jquery I need to retrieve an array from table cells, format the data
I'm using INSERT INTO to copy rows of data from one table to another:
I am trying to copy data from my MYSQL table to SQL Server using
Im using vb.net and I need to fetch data from two different tables and

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.