Skip navigation
Currently Being Moderated

CSS styles for a row

Aug 19, 2013 11:22 PM

I want to include some css style for a row inside a table(which fetches results from database.)CSS style works for the table but not for the row inside.Pls help.


Here is my code:(inside php script)


echo "<table align=\"center\" class=\"studinfo\">

        <tr class=\"studinforow\"><td>Name:</td><td>".$row['Name']."</td></tr>

        <tr class=\"studinforow\"><td>Exam No:</td><td>".$row['Examno']."</td></tr>

        <tr class=\"studinforow\"><td>Roll No:</td><td>".$row['Rno']."</td></tr>

        <tr class=\"studinforow\"><td>Semester:</td><td>".$row['Sem']."</td></tr> </table>";


CSS code:


.studinfo {

    margin-top: 20px;

    background-color: #E9F9FC;

    margin-bottom: 10px;

    width: 350px;

    font-family: Sintony;

    font-size: 13px;

    line-height: 22px;

    padding: 5px;

    border: 1px solid #AEE8F4;

    height: 150px;


.studinforow {

    padding: 25px;


  • Currently Being Moderated
    Aug 19, 2013 11:32 PM   in reply to Roopavathy

    I don't think padding works on the <tr> tag so you may find you need to add it to the <td> tag:


    <td class=\"studinforow\">Semester:</td><td class=\"studinforow\">".$row['Sem']."</td>




    You could just add the padding like below instead on every <td> tag:


    .studinfo td {

    padding: 25px;


    Mark as:
  • Currently Being Moderated
    Aug 19, 2013 11:59 PM   in reply to Roopavathy

    Hello Roopavathy,


    in my records I have found this explanation, maybe you would have some benefits from it:





    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points