PHP Classes

question

Recommend this page to a friend!

      PHP Array into HTML Table  >  All threads  >  question  >  (Un) Subscribe thread alerts  
Subject:question
Summary:How to make Row color
Messages:12
Author:Csík Csaba
Date:2017-02-27 17:17:14
 
  1 - 10   11 - 12  

  11. Re: question   Reply   Report abuse  
Picture of Csík Csaba Csík Csaba - 2017-08-29 07:39:41 - In reply to message 9 from Alexandre Sinício
hello how to setting align with row odd and row even.

Please help for me. Thank you.

  12. Re: question   Reply   Report abuse  
Picture of Alexandre Sinício Alexandre Sinício - 2017-08-29 11:11:00 - In reply to message 11 from Csík Csaba
I'll assume you are already OK constructing the table using this class.

In that case, let's consider you have multiple tables, each one with an unique identifier:

FIRST TABLE
<table id='table1'>
<tr>........</tr>
<tr>........</tr>
</table>

SECOND TABLE
<table id='table2'>
<tr>........</tr>
<tr>........</tr>
</table>

Then, just use CSS. Something like this:

//ALL CELLS FROM EVEN ROWS OF TABLE1 > ALIGN TEXT RIGHT
#table1 tr:nth-child(even) td {
text-align: right;
}

//ALL CELLS FROM ODD ROWS OF TABLE2 > ALIGN TEXT CENTER
#table2 tr:nth-child(odd) td {
text-align: center;
}

 
  1 - 10   11 - 12