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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:52:34+00:00 2026-05-20T22:52:34+00:00

This is my sample input <table id=1 style=width=100%> <tr> <td id=1> <table id=2 style=width=50%>

  • 0

This is my sample input

<table id="1" style="width=100%">
    <tr>
        <td id="1">
            <table id="2" style="width=50%">
                <tr>
                    <td id="2">
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

I am using xslt1.0. when ever the template match ‘td’ is matched, i need to find the corresponding table id value..For example, If the td with id=1 is matched,i want to take style attribute value from table(id=1) and if the td with id=2 is matched,i want to take style attribute value from table(id=2). I have written ancestor::table/@style in my template, but both td are referring the styles of table with id=1.

  • 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-20T22:52:35+00:00Added an answer on May 20, 2026 at 10:52 pm

    I have written
    ancestor::table/@style in my
    template

    You were close. Because there can be more than one table in the ancestor axis, you need to get the first one like in ancestor::table[1]/@style. Of course, if you are absolute sure there is always a chain of table -> tr -> td (not optional tbody) then you could go with @Flack’s answer.

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

Sidebar

Related Questions

i am creating the textboxes dynamically using jquery on a button click. <table width=100%
Got a problem with a style in IE7. Using this css style table td
I create the table like this. <table border=1> <tr> <td width=250px rowspan=2><input type=image src=dash.jpg
I need to find the id of an image button (within table cell 1)
Does anyone know why the input elements with a width of 100% go over
I need to change background color of single cell in table using java script.
My html contains a table have the structure like this <table id=sample> <tr class=new_input_field>
After trying this simple console input with 5, the result is shown as 53
I built this simple script to input a certain number, Now I want to
I have this simple piece of HTML code: <div> <input type=file name=english-file /> </div>

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.