background-color in tables not working


Topic: background-color in tables not working

gerdhuber pro asked 9 months ago

Expected behavior Only the second tr ist working. the first with background-color doesn't work any more. I want to change the color. What have i to do ?

Actual behavior

Resources (screenshots, code snippets etc.)

    <thead>
      <tr class="table-primary font-weight-bold">
        <th scope="col" class="h5">Datum</th>    
        <th scope="col" class="h5">Abteilung</th>     
        <th scope="col" class="h5">Termin / Ereignis</th> 
      </tr>
    </thead>

        <tbody>
            <tr style="background-color: #FFF8E1;">
                <td class="h6" id="r1">21.03.2024</td>
                <td class="h6">1AO</td>
                <td class="h6"><a href="/index.php?do=show_event&amp;key=38" class="text-info" rel="nofollow">Aktivengeburtstag: </a></td>
            </tr>
            <tr class="table-info">
                <td class="h6" id="r2">04.05.2024  <em>00:00 - 23:59</em> Uhr</td>
                <td class="h6">Verein</td>
                <td class="h6"><a href="/index.php?do=show_event&amp;key=483" class="text-info" rel="nofollow">Unterhaltungskonzert 2024</a></td>
            </tr>

Kamila Pieńkowska staff answered 9 months ago

We do not transefr styles from the table you use to init datatable. If you want to style your table you cannot use inline CSS on td or tr tags.

You can use CSS that target your table or if you want to style specific cells you can please div tag in it and any styles used on that tag will be applied.


gerdhuber pro commented 9 months ago

Thank you.

can i have an example please.

Gerd


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 7.2.0
  • Device: PC
  • Browser: all
  • OS: windows
  • Provided sample code: No
  • Provided link: No