Bulma table rows not extending to the complete width

In my angular7 app, I have implemented a is-fullwidth Bulma table that is functioning correctly. However, I now need to incorporate an angular component within each row, with the td tags contained in that component. The issue arises when I do this, as the table rows no longer span its full width.

<table class="table is-fullwidth">
  <thead>
    <tr>
      <th>Column 1</th>
      <th>Column 2</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let row of rows">
      <app-table-row [details]="row">
      </app-table-row>
    </tr>
  </tbody>
</table>

table-row.component.html

<td>
  <div *ngIf="!showField"> {{ details.name }} </div>
  <div *ngIf="showField" class="field">
    <div class="control">
      <input [value]="details.name" class="input" type="text">
    </div>
  </div>
</td>

<td>{{ details.address }}</td>

This setup produces the following result:

If I revert back to using regular td tags without the angular component, the table spans correctly. Like this.

Why does it not work when the angular component is added? And how can this issue be resolved?

Answer №1

The issue arises due to the td elements not being direct children of the tr, but rather children of the app-table-row component.

In your situation, you might consider modifying the selector property in the app-table-row component to target the tr directly, like this:

@Component({
    selector: 'tr[app-table-row]',
    ...
})
export class AppTableRowComponent  {}

Then, utilize it as follows:

<table class="table is-fullwidth">
  <thead>
    <tr>
      <th>Column 1</th>
      <th>Column 2</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let row of rows" app-table-row [details]="row">
    </tr>
  </tbody>
</table>

This adjustment eliminates the need for app-table-row to be a distinct node within the DOM hierarchy.

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

Using Jquery variables for calculations and they do not work with numerical values

Hey there, I'm new to this so bear with me. I have a jQuery question that's puzzling me... I'm attempting to set the line height using the following method: var line_height = $('.container').css("height"); console.log(line_height ...

Encountering Main.js Path Error in Asp.net Core and Angular 2 Integration

I am currently in the process of developing an asp.net core application with Angular 2 and utilizing Angular Quickstart for assistance. With the flexibility provided by Asp.Net core application to use wwwroot as a folder, I have consolidated all dependenc ...

dynamic resizing, uniform dimensions

Is it possible to use CSS to ensure that an image is 100% the width of a fluid div without distorting the square shape? The goal is to match the height to the width for a cohesive look. Currently, I am using the following code for fluid width: .img{ max ...

Activate Materialize Css Tooltip with a click to reveal its content

How can I make the tooltip appear when clicked? Here is my code. Your assistance would be greatly appreciated. <a href="javascript:;" class="tooltipped info_circle" data-position="bottom" data-delay="50" data-tooltip="Numbers should MUST be 5 digits. N ...

Methods to close the currently active ngx-modal when a new modal is triggered within the same Angular 8 component

I am currently working on developing a versatile modal component that has the ability to be called from within the same modal itself. Is there any way to configure the component and modal in such a manner that when the reusable component is triggered, it ...

Adaptive design exhibits varying appearances across various screen sizes

Currently, I am working on a responsive design WordPress site and here is the markup: <div class="contact-wrap"> <div class="contact-number">123-456-7890</div><!--.contact-number--> <div class="user-login"><a href="#"& ...

In Ionic 3, the term "Twilio" is not recognized

Attempting to integrate Twilio into my Ionic 3 application has been a bit of a challenge. While it works fine when tested on a browser, running it on an actual device led to a frustrating error message: TypeError: undefined is not a function {stack: (...), ...

Responsive Menu Design with Bootstrap 3.x

In my web design, I have utilized Bootstrap 3.3.7 and it works flawlessly on mobile, desktop, and laptop devices. However, I have noticed that the three-bar menu does not appear on tablets when using the default Bootstrap navbar: <nav class="navbar nav ...

Displaying various results using a range slider

I really need some assistance in making this range slider produce multiple outputs. I've attempted a few different options, but unfortunately, I haven't been able to figure it out. My goal is to have the text "590" display as 5.9 times the value ...

What is the method for modifying the label of the "No Filter" choice in the PrimeNG Column Filter?

I am looking to customize the label for the "No Filter" option by translating it to "Sin Filtro" in Spanish. I have some knowledge about using the FilterMatchMode from FilterService to update filter match modes labels, like so: export const Filter ...

Tips for shrinking the circumference of a circle

Currently, I have a circular div that has been styled using CSS animations. My goal is to keep the size of the circle consistent when it moves to the bottom, but reduce its size when it bounces back to the top. I am uncertain if this can be achieved solely ...

What is the best way to split a Bootstrap navbar into two separate rows?

I'm struggling with breaking the navbar to have the navbar-brand in one row and the collapse menu in another. <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="72101d1d0601060013 ...

The sticky and flexible footers and headers CSS feature is functioning perfectly in WebKit, though it seems to be having difficulties in

I'm working on constructing a layout that features a header and footer with flexible heights, while the middle section takes up the remaining space. If there is overflow in the middle section, a scroll bar should appear specifically for that section. ...

Revving up the RxJS Engine: Unleashing the Potential of race

I'm currently working on implementing a unique input component that will execute a search when either the input value changes (with a debounce of 500ms) or when the enter key is pressed. My goal is to avoid emitting the search term twice - once on the ...

Tips on using dual drop-down menus for sorting options

I am encountering a small issue with my two filters. When I choose the values IN and ENCODE, all the values are displayed correctly... https://i.sstatic.net/Uoido.png However, the problem arises when I click on OUT, as the status is not displayed correc ...

What is the best way to create inline-block elements that stretch the entire width of their container?

How can the input field and button behavior be optimized for this specific display: ...

"I am looking for a way to incorporate animation into my Angular application when the data changes. Specifically, I am interested in adding animation effects to

Whenever I click on the left or right button, the data should come with animation. However, it did not work for me. I tried adding some void animation in Angular and placed a trigger on my HTML element. The animation worked when the page was refreshed, bu ...

Positioning of bottom navigation bars

Is there a way to ensure that the bottom navigation bar remains fixed at the bottom of the screen, regardless of the device's screen size? position: absolute; bottom: 0; width: 100%; While this solution works, it has been observed that when th ...

The reload button retains functionality while being present within an Angular2 form, allowing for a seamless user experience. The

After some observation, I have realized that when a button is placed inside a form but has no connection or function related to the form, such as a back or cancel button, it unexpectedly reloads the entire page. For instance, let's consider having ...