Ways to change the background color of cells with spaces in HTML to black

https://i.sstatic.net/rmtR1.png

How can I change the cells that have a space or any separator to be black in color?

This snippet shows my HTML code:

 <table >

        <thead class="table table-bordered table-responsive">

            <tr *ngFor="let ligne of grilleHaut">

                <td *ngFor="let charac of ligne.tabDesCar">{{charac}}</td>

            </tr>

            
        </thead>

    </table>

[![enter image description here][2]][2]

Answer №1

Give this solution a try and see if it works:

    <thead class="table table-bordered table-responsive">
        <tr *ngFor="let row of topGrid">

            <td *ngFor="let char of row.characterArray" style="padding: 0px;">

                <span *ngIf="char!=''"> {{char}}</span>
                <span *ngIf="char==''" style="background-color: black;width: 100%;height: 100%!important;display: table;">N/A</span>
            </td>
        </tr>


    </thead>

</table>

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

Refresh the information in the <ion-datetime> component by utilizing the formGroup

I am currently working with a form that has been created using 'FormBuilder'. The form includes a date control and I am trying to figure out how to update the data in that control using the patchValue() method. In the template, the control has d ...

I am attempting to calculate the width of my div element in Angular using NgStyle, incorporating two variables with varying units

I am attempting to create a width calculation using the calc() function, but I am encountering unexpected results when subtracting two variables with different units. [ngStyle]="{ 'width': calc(notHedgedProgress + '%' - newPosition ...

Setting the default value in the Angular input select

books.component.ts export class BooksComponent implements OnInit { public sortOrder; ... books.component.html <div class="form-group"> <label for="selectOrder">Sort</label> <select class="form ...

Using TypeScript with Vue and Pinia to access the store

Is it necessary to type the Store when importing it to TypeScript in a Pinia Vue project? // Component <p>{{ storeForm.firstName }}</p> // receiving an error "Property 'storeForm' does not exist on type" // Store ...

The element within the flexbox does not extend across the entire width, despite being designated as 100% full width

I'm currently attempting to center certain elements to ensure they are visually aligned. The upper div seems to have some odd space on the right, causing all the content within that div to be shifted and not accurately centered. On the other hand, th ...

The problem arises when the Chrome extension fails to trigger the XRM JavaScript code execution

Utilizing the XRM JS APIs within Dynamics CRM is my goal as I develop a Chrome extension. The code snippet below demonstrates my current approach. chrome.tabs.query({ currentWindow: true, active: true }, function(tabs) { chrome.scripting.executeScript({ ...

How to utilize FileReader for parsing a JSON document?

I'm currently facing an issue while attempting to read and copy a JSON file uploaded by the user into an array. When using .readAsText(), the returned data includes string formatting elements like \" and \n. Is there a way to utilize FileRe ...

Updating the video tag's source attribute using JSON information

I am in the process of creating a unique video player using HTML and Javascript that will sequentially play a set of videos until all 6 have been displayed. The URLs for these videos are stored within an array that is mapped in a .json file named clips.jso ...

Tips on centering elements vertically using Zurb Foundation

I'm trying to create a login form with the username and password fields centered in the middle of the screen using the Zurb Foundation package. Unfortunately, I'm struggling to get things aligned vertically. This is the code I have: <!DOCTYP ...

Adjusting the timeout for a particular operation according to its unique identifier

I am looking for a solution to call a method that posts an answer after an input change in my Angular project. I want to reset the timeout if another input change occurs to avoid multiple posts. Is there a smart way to achieve this? My project involves po ...

Disregarding boundaries set by divisions

Trying to keep things concise here. I have a division called "the box" with a fixed width of 1200px that contains various other divisions. One of these divisions is a links bar, known as the "pink bar", which has a width of 100% and a height of 25px. My is ...

How to extract information for divs with specific attribute values using Jquery

I have multiple divs with IDs like #result-1, #result-2, each followed by a prefix number. To count the number of list items within these divs, I use the following code: $(document).ready(function () { var colorCount = $('#result-1 .item-result ...

ValidationPipes do not support specific body types

Just a quick question: I'm working on applying a ValidationPipe to a POST endpoint responsible for adding an invoice. Before adding the invoice, I need to validate the body. Here is what I have done: invoice.dto.ts import { ContractorDto } from &apo ...

Getting the value from a dropdown menu and displaying it in a text area

I have 3 functions (radio, textarea, and dropdown) I was able to successfully retrieve the values of radio and textarea into the textarea. However, the drop down functionality is not working as expected. My goal is to display the selected option from the ...

What is the best way to use jQuery to animate a particular height up to 100%?

To provide a sneak peek of the content in the div, I have minimized it so only the first line is visible. Now, I want to add an animation that will expand the div to 100% height when you click the title. However, using animate(height:"100%") does not res ...

Highlight the active menu item using jQuery

Check out my menu example here: http://jsfiddle.net/hu5x3hL1/3/ Here is the HTML code: <ul id="menu" class="sidebar"> <li> <a href="#" class="clickme">Menu</a> <ul id="menu1"> <li><a class="dropdown-clas ...

What is the best way to conceal a panel using animation.css slide effects in GWT?

After creating a panel using GWT as shown below: VerticalPanel myPanel = new VerticalPanel(); I attempted to add animation CSS to myPanel in order to achieve sliding effects when hiding the panel like this: myPanel.addStyleName("animated slideInRight"); ...

I'm confused as to why the icon color isn't changing on the Blogger homepage for each individual user

I'm experimenting with changing the eye color based on visitor count. It works perfectly fine on static posts in my Blogger, but it fails to update the eye color properly on my homepage according to the set numeric values. Instead of displaying differ ...

Ensure the date is displayed in the format of dd-mm-yyyy when using the input type=date

Here is the code I am currently using : <input type="date" class="form-control" id="training_date" name="training_date" placeholder=" select" value="" onfocus="(this.type='date')" onfocusout="(this.type='date')" max=<?php echo ...

How can I float a square to the right in Bootstrap with a col-md-4 size but with a height restricted to only 200 px

Looking to add a small square on the page for users to search and purchase courses directly. The square should be 4 columns wide, follow Bootstrap4 grid template, and be around 200-300 px in length. It needs to remain visible as the user scrolls down the p ...