Design comparison
Solution retrospective
.
What challenges did you encounter, and how did you overcome them?Had Issues with formatting the Preparation Time section and Nutrition Table. For the nutrition table I was facing issue with introducing a in between each line. So I separated each line into a different table and then wrote a below. I am not sure if this is the right way to do it or if there is an efficient way.
What specific areas of your project would you like help with?.
Community feedback
- @rahulkumar215Posted 8 months ago
Hello @YugandarNR👋
Congratulations on successfully completing the challenge! 🎉
I have a suggestion regarding your code that I believe will be of great interest to you.
-
For Nutrition Part of the solution, We can define a table layout like this
<div class="Nutrition"> <h2>Nutrition</h2> <p> The table below shows nutritional values per serving without the additional fillings. </p> <table> <tr> <td>Calories</td> <td>277kcal</td> </tr> <tr> <td>Carbs</td> <td>0g</td> </tr> <tr> <td>Protein</td> <td>20g</td> </tr> <tr> <td>Fat</td> <td>22g</td> </tr> </table> </div>
then, to separate the nutrition and amount of nutrition, we can simply give the
table
awidth: 100%
. This will separate the nutrition and amount of nutrition with same space in-between.then we can style the table as
table{ border-collapse: collapse;}
this will remove the border from the table and now we can set the styles for table row like this
tr:not(:last-child){ border-bottom: 1px solid **table border color** }
this will give each table row except the last one a border-bottom.
then we can give some
padding-left
to the firsttd
of everytr
to bring it a little right side of the table as shown in the designtr:first-child{ padding-left: 30px;}
.and now just apply some styles to the other
td
of everytr
like you have in your solution.And there you have it
I hope you find this helpful 😄 Above all, the solution you submitted is great !
If you need any feedback or suggestions, I am happy to help
Have Fun Coding!
Marked as helpful0 -
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord