SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    vertical and horizontal text align with fixed width / lenght

    I need to provide vertical and horizontal alignment of text in a table cell. Text that does not fit into the table should overflow. If I use a CSS: vertial-align, adjust the width of the cell ignores the stretch.


    Code css:
    .ramec {         
      table-layout: fixed;
      display: table;
      width:49mm;
      height:15mm;
      margin-left:auto;
      margin-right:auto;
      background-color: rgb(230,230,230);     
      line-height:10px;
      overflow:hidden;
      white-space:nowrap;
      padding:1px;
    }
     
    .ramec2 {
      display: table-cell;
      vertical-align: middle;
    }

    HTML Code:
    <div class="ramec">
     <div class="ramec2">
       <p><? echo $zobraz_nahled; ?></p>
     </div>  
    </div>
    Last edited by ScallioXTX; Apr 7, 2011 at 06:42. Reason: wrapped in bb tags and added indenting

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this

    Code CSS:
    .ramec {         
      table-layout: fixed;
      display: table;
      width:49mm;
      height:15mm;
      margin-left:auto;
      margin-right:auto;
      background-color: rgb(230,230,230);
      font-size:10px;
      line-height:10px;
      overflow:hidden;
      padding:1px;
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •