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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:54:40+00:00 2026-06-15T09:54:40+00:00

The situation: A table with width set to 100% , that has a cell

  • 0

The situation:

A table with width set to 100%, that has a cell inside with 1000px width. The table is centered, and so is the cell.

I would like to have a gradient from left to right, and right to left that would end at the beginning of the centered cell, with the same color as the cell.

The problem is, to occupy the whole page, no matter what size the browser is, the table is set to 100%, the cell is set to 1000px so it’ll never change its size,

How can i achieve, if possible, what i want, making sure that in smaller resolutions/monitors or with window re sizing, the gradient will stop at the beginning of that cell, since gradients are set with percentage?

  • 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-15T09:54:42+00:00Added an answer on June 15, 2026 at 9:54 am

    Is something like this what you want?

    <table cellspacing="0" cellpadding="0">
      <tr>
        <td class="left">&nbsp;</td>
        <td class="center">Your content goes here</td>
        <td class="right">&nbsp;</td>
      </tr>
    </table>​
    

    styled such that

    table {
      /* the table takes up all the space */
      width: 100%;
    }
    td.center {
      /* there is one container column */
      width: 1000px;
      text-align: center;
      color: white;
      background-color: black; /* some fixed background color */
    }
    /* and two columns on the side which fade to some other color, in the respective directions */
    td.left {
      background: -webkit-gradient(linear, left, right, from(white), to(black));
      background: -webkit-linear-gradient(left, white, black);
      background:    -moz-linear-gradient(left, white, black);
      background:     -ms-linear-gradient(left, white, black);
      background:      -o-linear-gradient(left, white, black);
      background:         linear-gradient(left, white, black);
    }
    td.right {
      background: -webkit-gradient(linear, right, left, from(white), to(black));
      background: -webkit-linear-gradient(right, white, black);
      background:    -moz-linear-gradient(right, white, black);
      background:     -ms-linear-gradient(right, white, black);
      background:      -o-linear-gradient(right, white, black);
      background:         linear-gradient(right, white, black);
    }
    

    You can try this example here: http://jsfiddle.net/qvum4/1/

    UPDATE

    However, if you don’t have a specific reason to use tables, and you only want to achieve this effect, you shouldn’t use tables.
    There are a few jQuery gradient plugins around, that you can try to use.

    Of you could develop a custom jQuery solution, in order to keep all the styling gibberish outside of the markup.
    Try this example here: http://jsfiddle.net/YnUpY/1/

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

Sidebar

Related Questions

Here's the situation: I would like to iterate through a table with input controls,
I have the following situation: An Conversations entity/table which has multiple Tags associated to
Here is my situation: I have one table that contains a list of drugs
I have user subscriptions in my DB, and the SUBSCRIPTIONS table has UID (that
I have a process A that contains a table in memory with a set
I have a table in MS SQL 2005. And would like to do: update
This is the situation: I have a table in an Oracle SQL DB. That
I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with
The situation is this: I have a div with overflow auto containing a table.
I've got a situation like this: Table: FunTable ItemKey ItemName ItemPriceEffectiveDate ItemPrice 11 ItemA

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.