Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6583749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:26:59+00:00 2026-05-25T16:26:59+00:00

How could I force span to be bottom of table td? I have this

  • 0

How could I force span to be bottom of table td?

I have this code:

<td>
    <span class='cat-otsikko'>Product title</span>
    <span class='cat-hinta'>Product price</span>
</td>

And I would like to force cat-hinta to be always bottom of the td. How could I get this done?
I need it because I want product price to always be bottom of the table, so it does not depend of product title (it may be 1-3 lines long).

EDIT:

Fancy´s code did not work. Here is the whole code I have: (tuotteet is class of the table)

.tuotteet tr{
border:1px dashed gray;
}

.tuotteet td {
width:30%;
border-right:dashed 1px gray;
border-bottom:dashed 1px gray;
padding:5px 2px 5px 2px;
border-top:dashed 1px gray;
text-align:center;
position: absolute;
}


.cat-otsikko {
font-weight:bold;
font-size:101%;
}

.cat-hinta {
font-size:108%;
color:#ED1C24;
font-weight:bold;
display:block;
bottom:0px;
position: absolute;
bottom: 0;
}

Edit 2

I tried Jeaffrey´s code but it seemed too complex for me.
So, how I could embed the mu is too short user code in this script:

<table border="0" class="tuotteet">
<?php
$productsPerRow = 3;

for($i=0;$i<$count;$i++){
if($i % $productsPerRow == 0) { 
print"<tr>"; 
} 

$tuote = $prods[$i];
print"
<td>
    <span class='cat-otsikko'>".buildLink('prod', $tuote['id'])."</span>
    <div class='product-alaosa'>
        <span class='cat-hinta'>".price($tuote['hinta'])."</span>
        <span class='cat-kori'><a class='button green medium' href='".buildUrl("addtocart", $id)."'>Lisää ostoskoriin</a></span>
    </div>
</td>
 \n";

 if($i % $productsPerRow == $productsPerRow - 1) { 
 print"</tr>"; 
 } 

}

?>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:27:00+00:00Added an answer on May 25, 2026 at 4:27 pm

    The CSS vertical positioning model is, um, rather limited so you have to kludge around it.

    You can’t use absolute positioning because that removes elements from the normal document flow and you’ll end up with overlapping elements unless you can specify how tall everything is.

    One thing you can do is to split your single cell into two cells and then add rowspan="2" to the rest of the cells in that row:

    <tr>
        <td class="top">
            <span class='cat-otsikko'>Product title</span>
        </td>
        <td rowspan="2">
            Short
        </td>
    </tr>
    <tr>
        <td class="bottom">
            <span class='cat-hinta'>Product price</span>
        </td>
    </tr>
    

    And then use vertical alignment on the two table cells:

    td.top {
        vertical-align: top;
        border: 1px solid red;
    }
    td.bottom {
        vertical-align: bottom;
        border: 1px solid green;
    }
    

    And a demo: http://jsfiddle.net/ambiguous/Es6Tn/

    This is ugly but it will work and non-trivial vertical alignment in CSS is pretty much always ugly unless you want to pixel-position everything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could this be done with javascript/jQuery : <div class=number>99,123,123</div> <div class=number>123,123,123</div> <div class=number>1,123,123,123</div> <div
Could someone please suggest why this is happening... I’ve got some code to pretty
Is there any Javascript library that could force an HTML node (mostly images and
Could someone please tell me why this <%= destroy_password_url @user.password_reset_token %> generates http://localhost:3000/api/destroy_password.4G5EoRVYMUAtiIKqOerKsw routes.rb
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
I have a header/title bar that isn't resizing the way I want it to.
I have some code that I want to refactor. I have lots of methods
As you may know, Github forces an HTTPS connection. How could I force the
I have a problem with SSRS Report Manager web application(but again I see this
Could I force changing the view's orientation in order to test how the layout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.