Adjusting the labels in Datatable.net for optimal viewing size

I have integrated data table.net into my website and encountered an issue with the labels in the status column. The labels for 'in progress', 'assigned', and 'not assigned' are not wrapping properly.

I have tried using text-wrap and inline styles to resolve this problem, but without success. My website is built using Bootstrap 4.

Below is the structure of the table:

<table class="table table-separate table-head-custom table-checkable" id="linetb">
                    <thead>
                        <tr>
                            <th>Reg ID</th>
                            <th>Customer Name</th>
                            <th>Contact No</th>
                            <th class="p-">Service Type</th>
                            <th>FTTH Package</th>
                            <th>FDP</th>
                            <th>Received Date</th>
                            <th>Assigned Date</th>
                            <th>Status</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>112234455</td>
                            <td>Ms John Fernando</td>
                            <td>0736252738</td>
                            <td>CREATE</td>
                            <td>IP</td>
                            <td>HC-23S-0-34y473-434233-1</td>
                            <td>10/15/2017</td>
                            <td>10/15/2017</td>
                            <td><span class="label label-lines label-success font-weight-bolder label-pill label-inline mr-2">IN PROGRESS</span></td>
                            <td nowrap="nowrap"></td>
                        </tr>

Here are the styles used:

.label.label-inline {
    width: auto;
}

.label.label-pill {
    border-radius: none;
}

.label.label-inline {
    width: auto;
    padding: 0.2rem 2rem;
    border-radius: 0.42rem;
}
.label.label-hello-sucess {
    color: #6d7517;
    background-color: #c2d50061;
}

The text inside the label is not properly wrapped. You can view the image here.

Answer №1

Have you experimented with the following:

white-space: nowrap

Here is an example:

.nowrap
{
   white-space: nowrap;
}

<td>
<span class="nowrap label label-lines label-success font-weight-bolder label-pill label-inline mr-2">
IN PROGRESS
</span></td>

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

While browsing in Firefox and moving the cursor over a sub element

While hovering over a child element in Firefox using the rule .parent:hover > .child { /*style*/ }, the child element is considered separate from the parent element and does not receive styling. For example, in Firefox when you hover over the button, on ...

The Animation effect of jQuery Making an Element Move Down

After playing around with a jsFiddle, I'm faced with a dilemma. When I try to animate a "drawer" using jQuery, my text mysteriously jumps down a few pixels during the slide animation. It's puzzling me and I'm struggling to pinpoint the cause ...

Stop right-floating elements from switching positions

Every time I float two elements to the right, they end up getting swapped. This issue doesn't seem to happen with left floated elements and occurs consistently across all browsers. For example: CODE: <style type="text/css"> .right { ...

What's the best way to update the menu element colors as I scroll down the page?

I am looking to update the color scheme of menu elements as the page scrolls using the provided template. I tried a few methods, but they lack dynamism. How can I make it more dynamic? $(document).ready(function(){ //scroll animation $('.navigati ...

"Utilizing JavaScript, you can remove an element by clicking on the outer element within the

I need the functionality where, when a user clicks on an input type="checkbox", a corresponding textarea is displayed. Then, if the user clicks anywhere except for that specific textarea, it should be hidden. Can someone assist me with implementing this fe ...

What's the reason behind CSS selectors not allowing empty spaces, while XPath does?

Why is it that Xpath is able to find an HTML element with a class attribute containing empty spaces, while CSS cannot? # Element: <div class="I Love StackOverFlow"></div> self.page.locator('//div[@class="I Love StackOverFlo ...

Dynamic resizing in NextJs does not trigger a re-render

My goal is to dynamically pass the width value to a component's styles. Everything works fine on initial load, but when I resize the window, the component fails to re-render even though the hook is functioning as intended. I came across some informat ...

What is the rationale behind placing the CSS outside of the React function components, near the imports?

Recently, I encountered an issue with loading CSS inside a React function component using Material UI. Even though I managed to resolve it, I am still intrigued by the underlying reason. Initially, I had something like this setup where I placed both makeSt ...

CSS form not aligning properly within wrapper div and appears to be floating outside of it

I am in the process of creating a website that includes a wrapper div containing a: -Header -Content -Footer The issue I am encountering is when I insert regular text into the content section, everything displays properly and the background stretches s ...

React App Showing Scrollbar When Material UI AppBar is Present

I'm encountering a straightforward issue in my React application. How can I get rid of the scrollbar on my page? It seems like the problem arises from the height value I set to 100vh. However, upon removing the AppBar, the scrollbar disappears. Any su ...

The Parent Div is styled with a background color, and I would like the sub div to inherit the background from whatever is behind the

I have a website at . When you click on a blue tab (except the middle left one), a larger tab appears with two Divs inside. What I am trying to achieve is having the sub divs show what's behind the green Div, especially while it's in motion. This ...

What is the best way to align two round buttons on each line with a single button centered above them, all without any spacing between the buttons below, and vice versa

https://i.sstatic.net/oOwY6.png Is it possible to align the buttons on the left side like they appear on the right? Each group should have padding and display with flow-root. .group { display: flow-root; padding: 7px 0px 7px 0px; } button.a { ...

Using Multiple SCSS Files to Reference a Centralized Style Sheet

I am currently developing a React application and facing an issue with my SCSS files. I have three SCSS files, one main file that contains theme variable colors, and the other two are located in component folders. When I import the main SCSS file into the ...

Limiting the size of textboxes in Twitter Bootstrap

I am currently working with bootstrap text boxes in the following manner: <div class="row"> <div class="col-lg-4"> <p> <label>Contact List</label> <select class="form-control" id="list" name="li ...

Experiencing difficulty adjusting the width of a Tumblr post with JavaScript or jQuery?

Calling all coding experts! I've been working on customizing a Tumblr theme, and everything is looking good except for one issue. I'm struggling to adjust the width of photos on a permalink (post) page. Check out this link: You'll notice t ...

Creating a vertical line at the bottom using CSS

Is it possible to add a centered line to the bottom of the "numberCircle" in a responsive table created with twitter-bootstrap? I would like it to look like this image: https://i.sstatic.net/WKgFu.jpg Thank you .numberCircle { border-radius: 50%; ...

The footer in the CSS has an excessively large margin-top that needs to be adjusted

In my case, I am using a template where the same page is repeated with the same template. However, there seems to be a massive margin-top element on three of my pages, and unfortunately, I can't seem to get rid of it. I attempted adding a style="marg ...

Manipulating contextual selectors

Have you ever tried reverting or overriding attributes from contextual selectors? .card { padding-top: 20px; ... } .card .card-header { padding: 0 20px; } .card .card-header.news { padding-top: 0px; } Do you think it's possible to elimina ...

Jssor Slider: Captions briefly overlap just as the slideshow begins to play

I am currently working on a slideshow with 3 caption-only slides. Here is the code snippet: <div id="sliderHeader_container" style="position: relative; width: 965px; height: 85px;"> <!-- Slides Container --> <div u="slides" style=" ...

Optimizing Bootstrap for Tablet Browsing in Internet Explorer

Hey there, I have a question regarding Internet Explorer and tablets. As I revamp this website and integrate Bootstrap into it, my focus is currently on the small-sized IE browser for tablets. My dilemma arises from not knowing if there are any tablets th ...