7
How to put a background color on a TR element created dynamically
source link: https://www.codesd.com/item/how-to-put-a-background-color-on-a-tr-element-created-dynamically.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to put a background color on a TR element created dynamically
advertisements
I used the Bootstrap date-time picker and now I need to put a background color to an element inside bootstrap calendar.
I have created this HTML:
<tr HERE I NEED STYLE>
<td>
<span class="timepicker-hour" data-time-component="hours" title="Pick Hour" data-action="showHours">01</span>
</td>
<td class="separator">:</td>
<td>
<span class="timepicker-minute" data-time-component="minutes" title="Pick Minute" data-action="showMinutes">30</span>
</td>
<td>
<button class="btn btn-primary disabled" data-action="togglePeriod" tabindex="-1" title="Toggle Period">PM</button>
</td>
</tr>
Is there easy way to put background on first TR element with css?
Hope it works!! Use inline style
<tr style="background-color:blue;"><td><span class="timepicker-hour" data-time-component="hours" title="Pick Hour" data-action="showHours">01</span></td><td class="separator">:</td><td><span class="timepicker-minute" data-time-component="minutes" title="Pick Minute" data-action="showMinutes">30</span></td><td><button class="btn btn-primary disabled" data-action="togglePeriod" tabindex="-1" title="Toggle Period">PM</button></td></tr>
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK