Format last different Select Mysql result

Asked

Viewed 54 times

0

I need to put the last result with a different format. as in a mysql table, for example.

<a class="registro">Valor 1</a>
<a class="registro">Valor 2</a>
<a id="ultimoregistro" class="registro">Valor 3</a>

I would like to classify the last record with a different formatting than the rest in PHP, as I do?.

1 answer

0

Hello, use CSS and not PHP or Mysql... Example:

ul a {
  color: blue;
}

ul li:last-child a {
  color: red;
}
<ul>
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>

  • It’s not about the style, it’s about the html structure of the last item. I want it to come back different from the previous ones.

  • Hello, good then is "structure" and not "formatting", nor does it "structure" in the original question... :-( "I need to put the last result with a different formatting" ==> You do not need to change the structure to do this, this is my tip ;-)

Browser other questions tagged

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