ajoy123rocks Posted March 2, 2022 Share Posted March 2, 2022 <div id="Curriculum" class="tabcontentref"> <table style="margin-left: 2%;width:50%"> <tr> <td><p class="Docs"><b>INTRODUCTION TO LEVEL 1</b> (Version 2.0, 2021)</td> <td><a href="https://drive.google.com/file/d/1FGL-JeWTK-y_mzmA_FdAYwdy-0D8xleA/view?usp=sharing" download target="_blank"class = "buttonvid"> <i class="fa fa-download"></i> Download</a></p></td> </tr> <tr> <td><p class="Docs"><b>REFEREE COURSE - LEVEL 1</b> (Version 2.0, 2021)</td> <td><a href="https://drive.google.com/file/d/1ZcO_DmDrlFYxONgdpy8UEECfAr1I14RB/view?usp=sharing" download target="_blank"class = "buttonvid"> <i class="fa fa-download"></i> Download</a></p></td> </tr> <tr> <td><p class="Docs"><b>REFEREE COURSE - LEVEL 2</b> (Version 2.0, 2021)</td> <td><a href="https://drive.google.com/file/d/1umYT1Vl6OjrixccNNOqFi9yoaXtY8k6b/view?usp=sharing" download target="_blank"class = "buttonvid"> <i class="fa fa-download"></i> Download</a></p></td> </tr> <tr> <td><p class="Docs"><b>REFEREE COURSE - LEVEL 3</b> (Version 2.0, 2021)</td> <td><a href="https://drive.google.com/file/d/12-MxZwscvjYSS29czMNp3kH-rgrf5pWC/view?usp=sharing" download target="_blank"class = "buttonvid"> <i class="fa fa-download"></i> Download</a></p></td> </tr> </table> td,tr { border-style: none; text-align: left; } .buttonvid{ padding: 2px 10px; border-color: white; font-size:12px; font-family: tahoma; font-weight: bold; } .buttonvid{ border: 2px solid var(--primary-color); ; color: black; text-transform: uppercase; transition: all 0.5s ease-in-out; border-radius: 10px; background: var(--primary-color); ; font-weight: bold; } .buttonvid:hover,.buttonvid:focus{ background: transparent; text-decoration: none; color: white; font-weight: bold; outline: none; cursor: pointer; } The 2nd column data is not getting aligned vertically in the middle. Seems like it is vertically aligned in the top. I tried giving "vertical-align:middle" in the CSS file, but still did not get it aligned. Link to comment Share on other sites More sharing options...
Ingolme Posted March 2, 2022 Share Posted March 2, 2022 Setting vertical-align:middle on the <td> element should do it. Link to comment Share on other sites More sharing options...
ajoy123rocks Posted March 2, 2022 Author Share Posted March 2, 2022 <tr> <td><p class="Docs"><b>INTRODUCTION TO LEVEL 1</b> (Version 2.0, 2021)</td> <td vertical-align:middle><a href="https://drive.google.com/file/d/1FGL-JeWTK-y_mzmA_FdAYwdy-0D8xleA/view?usp=sharing" download target="_blank"class = "buttonvid"> <i class="fa fa-download"></i> Download</a></p></td> </tr> Tried it.. did not work. Link to comment Share on other sites More sharing options...
ajoy123rocks Posted March 2, 2022 Author Share Posted March 2, 2022 Found the culprit.. Class = "Docs".. removed the margins and it worked fine. .Docs{ font-size: large; color: var(--primary-color); margin: 10px ; margin-left: 5%; margin-right: 5%; margin-top:2%; } Link to comment Share on other sites More sharing options...
ajoy123rocks Posted March 2, 2022 Author Share Posted March 2, 2022 The problem still persists. Actually the real problem was something else... all the rows were not getting vertically aligned in the middle. I found this when i changed the border to dotted. td,tr { border-style: dotted; text-align: left; } .Docs{ font-size: large; color: var(--primary-color); } Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2022 Share Posted March 2, 2022 (edited) Each paragraph tag must have an equal closing tag in the same cell, you have paragraph crossing two cells. Your browser probably tries to correct this by adding opening/closing tags which results in a empty paragraph. So vertical-align: might be working, but! Its aligning a paragraph with text and without, so it looks as though its not. Inline styles use style attribute style="vertical-align: middle;". For vertical-align to work, the paragraph margin/padding top and bottom have to be equal and inline-height may need adjusting. Try adding background-color to paragraph to observe this. Edited March 2, 2022 by dsonesuk Link to comment Share on other sites More sharing options...
ajoy123rocks Posted March 2, 2022 Author Share Posted March 2, 2022 Yes.. The paragraph tag was the root cause. Changed the top and bottom margins and got it to work. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now