What is preventing the user from editing this bootstrap table?

I recently created a bootstrap table which looks like this:
https://i.sstatic.net/tNg2T.png

Below is the HTML code for the table:

<div class="card card">
      <div class="header">
        <div class="typo-line">
          <h4>Suivi des approbations</h4>
        </div>
        <!-- <h4 class="title">Table on Plain Background</h4> -->
        <!-- <p class="category">Here is a subtitle for this table</p> -->
      </div>
      <div class="content table-responsive table-full-width">
        <table class="table table-hover">
          <thead>
            <tr>
              <th *ngFor="let cell of tableData2.headerRow">{{ cell }}</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let row of tableData2.dataRows">
              <td *ngFor="let cell of row">{{ cell }}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>

And here's the TypeScript code relevant to it:
ngOnInit(){

   this.tableData2 = {
        headerRow: [ 'Version', 'Approbateur(nom+fonction)',  'Principales remarques', 'Date d\'approbation'],
        dataRows: [
            ['', '', '', ''],
            ['', '', '', ''],
            ['', '', '', ''],
            ['', '', '', ''],
            ['', '', '', ''],
            ['', '', '', ''],
            ['', '', '', ''],

        ]
    };

The current table rows are not editable. I have two questions:
1/ Why can't users edit the rows?
2/ How can I make them editable? Do I need to implement forms?
Thank you!

Answer №1

By default, you are unable to edit elements in HTML other than the input tag.

However, you can make an element editable by using the attribute contenteditable.

For example:

<div contenteditable='true'>
  <p>This paragraph is editable.</p>
</div>

This will allow the entire div to be edited as needed.

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

Assistance required in filling out a table solely through JavaScript with input from an HTML form

Hello, I am currently pursuing a second career and have just started learning HTML & JavaScript. For a simple assignment, I need to take user input in the form of numShares and numYears through HTML. My goal is to use JavaScript to populate a 3-column tabl ...

Retrieve data from an HTML form within an Angular 2 ag-grid component

I'm facing a challenge with incorporating form values from a modal into an ag-grid array in my HTML file. I'm unsure of the process to achieve this. Below is an excerpt from my file.html: <template #addTrainContent let-c="close" let-d="dismi ...

Why is the media query not affecting this image?

<div class="col-lg-6" > <img src = "iphone6.png" id="dog-mobile" alt="phone"> </div> #dog-mobile{ height:600px; position: absolute; right: 25%; transform: rotate(25deg); } ...

Karmic Dilemma: Anticipated a single request meeting the criteria but encountered 2 requests

Hello, I am currently working on writing a unit test case for the subscribe method of a controller in Angular. I seem to be encountering an issue with the second test case, as indicated by the following error message: Error: Expected one matching request ...

Javascript Popup Functionality Failing to Execute

It seems that the popup link does not function properly when placed between the <script> tags. if(data.userdata["money_back"] == 1){ chat_list += '<a data-popup-open="popup-90">Download</a>'; } On the other hand, when the pop ...

The identifier 'name' is not found in the specified data type

How can I resolve the error 'Property 'name' does not exist on type' in TypeScript? Here is the code block : **Environment.prod.ts** export const environment = { production: true, name:"(Production)", apiUrl: 'https://tes ...

Guide on creating a stationary side navigation bar in HTML with Bootstrap 5 and CSS

I am developing a website with a fixed side navigation bar that stays in place when scrolling through the content section. I experimented with both the fix-position in Bootstrap 5 and CSS methods, but no matter how I set it up, the side bar remains transpa ...

Web applications that utilize subtle data formats

Is it possible to format input data in HTML5, JavaScript, PHP and MySQL without changing the actual value? For instance, if we have <input value='10000.5'> The actual value is visible when looking at the html code, but on the website int ...

What is the best way to make my div equal in height to its preceding div sibling?

I want my new div to match the height of the previous one. I'm using percentages for width and height to ensure it displays properly on mobile devices as well. I've tried setting the parent elements to 100% width and height based on suggestions f ...

Having difficulty maintaining trailing zeroes in decimals after converting to float in Angular

I need assistance with converting a string to float in Angular. Whenever I use parseFloat, it seems to remove the zeros from the decimal values. How can I ensure that these zeros are retained with the numerical values? The example below should provide more ...

Replicating a tag and inputting the field content

Scenario: An issue arises with copying a label text and input field as one unit, instead of just the text. Solution Needed: Develop a method to copy both the text and the input field simultaneously by selecting the entire line. Challenge Encountered: Pre ...

Adjusting the overflow of a parent div based on the position of the div within it by scrolling

I'm trying to create a page with 3 different sections: <div class="container" id="main-container"> <div class="section" id="profile"> Hello World </div> <div class="section" id="projects"> Hello World 2 ...

Chrome is experiencing a delay in closing the Select Option dropdown menu

On my webpage, I have two select option buttons placed on different tabs. Whenever one button is changed, I want to update the value of the other button and assign it to a specific element like a span in the example code provided. While everything works sm ...

Scrollmagic - Creating dynamic effects by animating body and div backgrounds using multiple tweens

I'm currently developing a website that utilizes scrollmagic to smoothly transition the color of the active div (each set to size of the screen) from black back to white as you scroll down. The issue I am facing is that the body background color does ...

difficulty with closing nested Mat-dialogBoxes

I am facing an issue with passing data between multiple dialog boxes in my parent raster component. I have a parent raster component that opens the first dialog box, followed by a second dialog box. My goal is to pass data from the last dialog box back to ...

What is the mechanism through which a flexbox enlarges to accommodate its overflowing child elements?

I am working with a flexbox layout. Here is the HTML code structure: <div class="grid"> <div class="row"> <div class="column">Content</div> <div class="column">Content2</div> <div class="column">Con ...

Tips for maintaining interactivity after a page refresh

$(document).ready(function () { $("#2").click(function () { $("#content").load("{% url 'about' %}"); }); $("#3").click(function () { $("#content").load("{% url ...

What is the best way to place an anchor tag with an image inside a bootstrap grid cell?

I am facing an issue with a 9-cell grid that contains images using Bootstrap columns. The grid is responsive and functions perfectly when only images are present. However, I want to make the images clickable by placing them inside anchor tags (<a>). ...

Grid element's height does not correspond to the responsive square child dimension

In my latest project, I am developing a web application using React and Material-ui. One of the challenges I have encountered is creating a responsive square div for a map component. Unfortunately, attempting to implement a solution from a trick on iamstev ...

How to choose a single checkbox in Ionic 2 and retrieve its value

On my single screen, I have about 20 questions and answers retrieved from a database. To display the options, I am using checkboxes but struggling to implement the desired functionality. What I want is to allow only one checkbox selection out of 4 options ...