How to apply my Css to a child tag

Asked

Viewed 56 times

0

Inside my tableRow there is a tableHeader and I want to apply my CSS within the tableHeader How shall I proceed ?

<tr>
  <th><?= $properties['propertie_id'] ?></th>
  <th><?= $properties['empreendimento'] ?></th>
<tr>
  • Take a look at this post, it will help [https://answall.com/questions/292641/howit works

  • 1

    I don’t quite understand, what exactly is your question? on the dial? thead { estilos } doesn’t work?

  • It wouldn’t just put in CSS th { propriedades; } ?

1 answer

1


Try to use styling through the tag or by adding a class and referencing it in your css. See the example below taken from https://www.w3schools.com/css/css_table.asp this site is very good for learning styling, HTML, Bootstrap etc. I hope it may have helped, if by any chance this is not the question try to edit your question and be more specific in what you want:

.customers {
  border-collapse: collapse;
  width: 100%;
}

.customers td, .customers th {
  border: 1px solid #ddd;
  padding: 8px;
}

.customers th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #4CAF50;
  color: white;
}
<table class="customers">
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
  <tr>
    <td>Berglunds snabbköp</td>
    <td>Christina Berglund</td>
    <td>Sweden</td>
  </tr>
</table>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.