The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to valign text in cells with HTML?
sajox
post Jun 17 2020, 10:12 AM
Post #1





Group: Members
Posts: 9
Joined: 16-June 20
Member No.: 27,402



Hello everyone! I am currently learning HTML and CSS and I have a problem smile.gif When creating a table and entering data in it, I used valign in the code (Used for vertical centering of text). However, valign does not work in every cell but only in those I used rowspan ( Used to vertically join cells in different rows)

For example: <td valign = "top" rowspan = "3"> 4 </td> here vertically centers the text to the top without any problems

However when I apply this to a regular cell where I did not use rowspan for example like this

<td valign = "bottom"> 3 </td> It doesn't center the data I entered in the cell vertically at all.

Does anyone know what the problem is?

I will be very grateful for the answer biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 17 2020, 12:11 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



No. Could you post the whole table, please.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 17 2020, 12:54 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(sajox @ Jun 17 2020, 05:12 PM) *

I used valign in the code (Used for vertical centering of text).

Actually "middle" is the default value for VALIGN, so you shouldn't need to specify it at all if you want text in the vertical mid.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 17 2020, 02:46 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I don't think the OP wants it centered, he probably meant aligned. He uses valign="bottom".
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deb1
post Jun 19 2020, 12:52 PM
Post #5


Advanced Member
****

Group: Members
Posts: 109
Joined: 7-May 20
Member No.: 27,330



QUOTE(pandy @ Jun 17 2020, 02:46 PM) *

I don't think the OP wants it centered, he probably meant aligned. He uses valign="bottom".


what's OP?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 19 2020, 02:17 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Short for Original Poster, the person who started the thread.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 04:20 PM