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

  • Home
  • SEARCH
  • 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 8236111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:02:45+00:00 2026-06-07T19:02:45+00:00

I have a table whose values are displayed from a database but on the

  • 0

I have a table whose values are displayed from a database but on the 8th row second column it displays a value i.e. 8 which is a Canadian province i.e. ‘Ontario’ now i want the name of the province instead of the values. This is what the old site used and therefore, i do not want to change the data in the database as the it is really big in size. I want to use javascript so that it only shows this for the user to read rather than changing the values in the database.

The data is displaed in a table

<table>
<tr></tr>
 ...8th row<tr><td></td><td>Value lies here i.e. '8'</td></tr>
</table>

Here is how i want it

if the value is “0” it should show “Alberta”

if the value is “1” British Columbia

if the value is “2” Manitoba

if the value is “3” New Brunswick

if the value is “4” Newfoundland

if the value is “5” Nova Scotia

if the value is “6” Northwest Territories

if the value is “7” Nunavut

if the value is “8” Ontario

if the value is “9” Prince Edward Island

if the value is “10” Quebec

if the value is “11” Saskatchewan

if the value is “12” Yukon

“Thanks but the form is on a different page than where it shows the value” It should be using a if else statement that if 8th row second column shows ‘8’ then the value should display as ‘Ontario’

  • 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-07T19:02:47+00:00Added an answer on June 7, 2026 at 7:02 pm

    seems like a bad solution, but a simple selector

    var cell = $('#tableId tr:eq(7) td:eq(1)');
    var txt = cell.text();
    console.log(txt);
    var selectOption = $("#selectId option").eq(parseInt(txt,10))
    cell.text(selectOption.text());
    

    EDIT:

    var provs = ["Alberta","British Columbia"...];
    var cell = $('#tableId tr:eq(7) td:eq(1)');
    var index = parseInt(cell.text());
    cell.text(provs[index].text());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with a column whose values come from an Enumeration. I
I have a table whose td values are displayed as <table> <tr> <td><?=$something?></td> <td><?=$something?></td>
I have a table whose primary key is a column named St_ID . I
I have HTML table. I'm looping through table and iterate over each row whose
I have table in which I am inserting rows for employee but next time
I have a table which displays reviews written by users about products. The problem
I have a situation where I want to associate multiple values from one table
My question is Suppose I have a Column fname whose value is 'Nikhil' in
I have written an importer which copies data from a flat table into several
I have a table with a whole lot of numerical values in it, 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.