Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to make text/content in the 2nd TD top aligned?

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #249181
    mw84
    Participant

    Hi,

    I have the following HTML code, content for both the element with ID of “lPanel” and ID of “rPanel” are dynamically loaded. An issue is that content is the second TD or “rPanel” is not top aligned. How to fix it?

    Thanks.

        <Table vertical-align="top">
            <TR>
                <TD style="width:8%"></TD>
                <TD width="40%"> <div id="lPanel" class="scrollable"></div> </TD>
                <TD style="width:8%"></TD>
                <TD width="44%" vertical-align="top"> <div id="rPanel" style="text-align:top"></div> </TD>
            </TR>
        </Table>
    
    #249189
    Mottie
    Member

    Instead of using a table for layout, use css columns… check out this article: https://css-tricks.com/almanac/properties/c/columns/

    #249191
    Beverleyh
    Participant

    There is no vertical-align attribute – only a CSS property. Here is the correct syntax http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td_valign_css

    #249193
    GMK Hussain
    Participant

    try this code.

    http://codepen.io/anon/pen/JbVEMV

    table td{
      display:table-cell;
      vertical-align:top;
    }
    
    #249195
    Shikkediel
    Participant

    I don’t think you’d need to specify what is already the default value…

    #249201
    mw84
    Participant

    @GMK Hussain, thank you.

    #249202
    mw84
    Participant

    I’m using a messy inherited CSS file for the app, which has changed lots of default I’m afraid.

    #249203
    mw84
    Participant

    @Mottie, good to know, thanks.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.