The information in the table is spilling out beyond the boundaries

I'm facing an issue with my bootstrap table where if a field value is too long, the table extends past the container length. I tried using responsive-table to prevent this, but then a scroll bar appears at the bottom, making it difficult to view the data. Is there a way to make the row data wrap when the table reaches the container length?

Here is an image showing the problem: https://i.sstatic.net/Bo1dO.jpg

You can find a portion of my view along with the CSS and example here: https://jsfiddle.net/bsxtpoqd/

<div class="container">
    <div class="row tab-content">
        <div class="row">
            <h3>Assigned Games</h3>
            <p>Please enter a search string in the textbox to search for users</p>

            <form class="form-inline">
                <div class="form-group">
                    <input type="text" class="form-control" id="tableSearch" placeholder="Enter search term...">
                </div>
            </form>
           <div class="table">
                <table id="userTable" class="table">
                    <thead>
                        <tr>
                            <th>UserName</th>
                            <th>Alternate</th>
                            <th>Email</th>
                            <th>Assigned Games</th>
                            <th>Unassigned Games</th>
                       </tr>
                    </thead>
                    <tbody>
                        @foreach (var user in Model)
                        {
                            <tr>
                                <td>@Html.ActionLink(user.UserName, "_GameAssigner", "Admin", new { insUserId = user.InstitutionUserId }, new { @class = "modal-link" })</td>
                                <td>
                                    @user.AlternateId
                                </td>

                                <td>@user.Email</td>
                                <td>
                                    @if (user.Assigned.Any())
                                    {
                                        <a href="#" tabindex="0" role="button" data-toggle="popover" title="Games" data-trigger="focus"
                                           data-content="@foreach (var gameName in user.Assigned){<div>@gameName</div>}">
                                            @user.Assigned.Count</a>
                                    }
                                    else
                                    {
                                        <div class="text-warning">0</div>
                                    }
                                </td>
                                <td>
                                    @if (user.Unassigned.Any())
                                    {
                                        <a href="#" tabindex="0" role="button" data-toggle="popover" title="Games" data-trigger="focus"
                                           data-content="@foreach (var gameName in user.Unassigned) {<div>@gameName</div>}">
                                        @user.Unassigned.Count</a>
                                    }
                                    else
                                    {
                                        <div class="text-warning">0</div>
                                    }
                                </td>

                            </tr>
                        }

                    </tbody>

                </table>
            </div>
        </div>
    </div>
</div>

Answer №1

To solve the issue, it is important to split the lengthy term into smaller parts.

 <td style="word-break:break-all">

Answer №2

Here is what you are looking for:

<style>
td
{
 word-break: normal;
}
</style>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Arrange the div and ensure that the external JavaScript file functions properly when the page loads

I am encountering an issue with my JavaScript and CSS code. It works perfectly fine within the fiddle environment but fails to function properly outside of it. Here is the link to the fiddle When I embed the code into an HTML document directly, it does n ...

Browsing through the last items on a webpage

I have set up a jsfiddle that explains itself quite well: http://jsfiddle.net/nt7xzxur/ with the following smooth scrolling code: function smoothScroll(hash) { $('html, body').animate({ scrollTop: $(hash).offset().top }, 750); By clicking o ...

This video cannot be played on this platform due to its privacy settings

I'm facing a challenge with embedding my client's videos on our website. These videos have domain-level privacy settings, and I've been using the code provided by Vimeo. <div style="padding:28% 0 0 0;position:relative;"> ...

Currently utilizing Yii framework to customize the appearance of a DIV element by specifying the CSS properties within the View, and subsequently storing the CSS file

I am looking for a way to allow users to customize the properties of a parent div, such as color, background, and other CSS styles, directly from the WordPress theming dashboard interface. Can someone please guide me in the right direction? ...

jquery conflict between parent div hover function and child's hover function

I am experiencing an issue with a hover function on a parent element and child event. It seems that the child hover function is not working when hovering over the parent. Specifically, I have set up a hover function on both the "univ" div and the "heading ...

Creating a personalized grid display

I've been trying to achieve the following output with my code, but so far nothing has worked. Can someone help me identify what I may be doing wrong? I'm new to this, so any guidance would be greatly appreciated. (Please ignore the 'undefine ...

What is preventing this Node JS code from successfully serving a static PNG file?

To the administrators, I have spent hours scouring various resources for answers related to Node Js, Express, and serving static files. Despite my efforts on stackoverflow and other platforms, I have yet to find any solution that works for me. If my questi ...

Do not proceed with the form submission if the fields are left blank

I am facing a challenge with organizing two sets of data, "heat" and "cold", obtained from an external provider. The data is messy and I have trimmed down the code to focus on the main issue at hand. Both "heat" and "cold" have properties that users need t ...

Steps for resetting the HTML5 meter element

I have implemented the meter element to rate between 0 and 5, but I want to display a specific image for each value instead of the default meter style: <meter min="0" max="5" value="5"> <img width="80" height="20" alt="5 out of 5 stars" src=" ...

Adding Bootstrap to a button is a simple process that can enhance the

I am new to using Bootstrap and have a question. I am currently working with CodeIgniter for my website, and I have added the Bootstrap files to the asset folder along with my CodeIgniter file. I want to incorporate Bootstrap CSS into the following code: ...

Installing assets automatically in Netbeans for Symfony2

Whenever I test my application, I find myself having to run the following command in Netbeans: assets:install Repeating tasks gets quite tedious... Symfony2 requires running this command to ensure that modified files are placed in the correct location. ...

Concerning dilemma with a div element

I am using 2 different partial views in my main view: <div class="col-md-6"> @Html.Action("Chart", "Teams") </div> <div class="col-md-6"> @Html.Action("SeriesWinsChart", "Teams") </div> <div class="next-game"> & ...

I'm working with Angular 12, Bootstrap 5, and ngPrime, and I'm looking to overlap a p-dialog with another element in my project

Is there a way in Angular 12 with Bootstrap 5 using ngPrime to overlap a p-dialog over any other element without using z-index and CSS, solely relying on PrimeNG? I have tried using z-index with: .my-class{ z-index: 2147483647 !important; } However, ...

Click on a link to open it in the current tab with customized headers

In my Angular project, I am attempting to open a link by clicking a button that redirects to the specified URL using the following code: window.open(MY_LINK, "_self"); However, in this scenario, I also need to include an access token in the header when t ...

What is the process for converting inline SVG images on the server?

Looking to use inline SVG as a background-image for another element? Check out this example that currently only works in Chrome. If you need an alternative method, take a look at the simpler inline SVG from the RaphaelJS demo here. <svg height="480" ve ...

In JavaScript, you can ensure that only either :after or :before is executed, but not both

My html slider is causing me some trouble <div class="range-handle" style="left: 188.276px;">100,000</div> Upon loading the page, I noticed that in Firebug it appears like this https://i.sstatic.net/Rgqvo.png On the actual page, it looks li ...

Accessing Ionic rootScope within the config stateprovider - A step-by-step guide

Is it possible to access the value of $rootScope in the following line? .config(function($stateProvider, $urlRouterProvider) { $stateProvider // I am trying to retrieve the value of $rootScope here. } ...

Only one condition is met when using the Javascript if statement with the :checked and .bind methods

I need help creating an Override Button to disable auto-complete for a form using Javascript. I want the div "manualOverrideWarning" to display a warning if the button is selected, but my current function only works the first time the user presses the butt ...

Can a video or image be displayed in HTML using an absolute path from a disk named E: while the localhost files are located in C:?

I'm attempting to construct a basic webpage utilizing HTML and PHP to display various videos, each video within its own videoplayer. The issue arises when I try to find the videos (they are stored in a folder on my secondary hard drive labeled E:&bso ...

The default value of the input color in HTML/NextJS does not update when changed

Issue: The color input does not change when the default value (#ffffff) is declared. https://i.sstatic.net/BpqUj.png However, it works normally if I don't declare a default value. https://i.sstatic.net/0dBd6.png Note: Using NextJS framework. <i ...