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 8620227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:31:53+00:00 2026-06-12T06:31:53+00:00

I have created some tables which display transactions with the last column being the

  • 0

I have created some tables which display transactions with the last column being the amount fields. I need to display a total/subtotal just below this column. The problem is my table columns are set to % widths.

How can I ensure that the field displaying the total amount will be below the amount columns.

I think I need some kind of CSS code to keep the total field(div/span) tied to the table width but I am not sure how to do this.

Thanks.

Example:

Col1 Col2 Col3 Amount
A      B    C    100
D      E    F    100
          Total: 200

EDIT: I should also have said that this table is dynamic. Its created using Visualforce (a native force.com language). The UI is then rendered into HTML and I do have CSS to format the resulting HTML table. Since I have no idea in advance of how many rows I can have, I cannot simply add a row for the totals and wanted to see if there was a better solution.

  • 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-06-12T06:31:54+00:00Added an answer on June 12, 2026 at 6:31 am

    CODE

    <!-- Style -->
    <style>
       #total {
          text-align:right;
       }
    
       #table {
          border:1px solid red;
          border-collapse:separate;
       }
    
       #table th, #table td {
          border:1px solid #000;
       }
    </style>
    <!-- Table -->
    <table id="table">
      <thead>
       <tr>
         <th>Col1</th>
         <th>Col2</th>
         <th>Col3</th>
         <th>Amount</th>
       </tr>
      </thead>
      <tbody>
       <tr>
         <td>A</td>
         <td>B</td>
         <td>C</td>
         <td>100</td>
       </tr>
       <tr>
         <td>D</td>
         <td>E</td>
         <td>F</td>
         <td>100</td>
       </tr>
      </tbody>
      <tfoot>
        <tr>
          <th id="total" colspan="3">Total :</th>
          <td>200</td>
        </tr>
       </tfoot>
     </table>

    The ‘Total’ label is located in th that spans 2 columns (check cinnamon comment). A style applied to this cell moves all text on the right. The total number (200) is aligned with the other results.

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

Sidebar

Related Questions

I have created some python code which creates an object in a loop, and
I have some css issue which I don't understand. I have created default mvc
I have a spreadsheet I created mid-August which has a table with one column
I have created a JDialog which displays two different tables. When the user selects
I have a table where I created an INSTEAD OF trigger to enforce some
I have created some JQuery that will expand a div 'popup' on hover and
I have created some tests in my WPF application. Right now I am working
I have created some functional categories that I use to show/hide markup elements. However,
I have created some simple charts (of type FastLine) with MSChart and update them
I have created some documents and managed to make some simple queries but I

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.