Now ask the question correctly

The problem is that I want to make a conclusion on 2 articles in a row (horizontally), currently 1 article is displayed vertically. Output code:

printf (" <table align='center' class='lesson'> <tr> <td class='lesson_title'> <p class='lesson_name'> <a class='a' href='view_obzor.php?id=%s'>%s</a> </p> <p class='lesson_adds'>Дата добавления: %s</p> <p class='lesson_adds'>Автор урока: %s</p> </td> </tr> <tr> <td> <p class='lessons_text'>%s</p> <p class='lesson_view'>Просмотров: %s &nbsp;&nbsp; Рейтинг: <img src='images/%s.gif'> </p> </td> </tr> </table> <br> <br> ", $myrow["id"], $myrow["title"], $myrow["date"], $myrow["author"], $myrow["description"], $myrow["view"], $r); 

Css code:

  .lesson { border: 1px solid#aec3f8; border - radius: 15px 15px 15px 15px; width: 35 %; } 

Images as is:

alt text

I would like to achieve this result. Approximately so there all the lines indicated:

alt text

Thanks in advance, I hope I correctly described the essence of the problem.

Sincerely, StrannicK.

    2 answers 2

    For example, I can advise you to add style="vertical-align:top" . Use block layout better.

     .container { display: block; width: 500px; overflow: hidden; }.lesson { float: left; width: 240px; height: 100px; margin: 5px; } 


      If you like tabular layout so much, then wrap each of your constructs into another table of two cells (td) in rows. Example:

       <table> <tr> <td><table align='center' class='lesson'></table></td> <td><table align='center' class='lesson'></table></td> <tr> </table> 

      The second option. css:

        .lesson { float:left; } 

      In this case, the width of the lesson table should be styled and should be less than half of the parent element.

      • hehe even worse, almost, but it climbs out of the block
      • Worse after what? Judging by the shift and different widths of the columns, we decided to use another table. Therefore, check carefully if all tags are closed. And it is better to explicitly specify the width of the cells in the parent table. - FLK