Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - Add thead/tbody elements to table #259

Open
janahanEDH opened this issue Nov 28, 2014 · 8 comments
Open

Feature request - Add thead/tbody elements to table #259

janahanEDH opened this issue Nov 28, 2014 · 8 comments
Assignees

Comments

@janahanEDH
Copy link

Please add thead_element and tbody_element. This is useful for getting just the data rows or the header row from a table.

@evmorov
Copy link

evmorov commented Dec 8, 2014

Upvote!

@AlexisKAndersen
Copy link
Collaborator

As long as there isn't a specific behavior needed for these elements, they can be defined like this:

element(:my_header, :theader, :id => 'theader_id')
element(:my_body, :tbody, :id => 'tbody_id')

and as long as you have a good identifier, any element can be identified as

element(:my_element, :element, :id => 'my_element_id')

@snowe2010
Copy link

@daneandersen Where is this functionality defined? What exactly are :theader and :tbody in this case?

Edit: Ah never mind, I thought you were referencing the element() method as being any element method, not this one. I understand now.

@AlexisKAndersen
Copy link
Collaborator

no, I was specifically referencing the linked method. It takes a tag of the specific type of element you are looking for. That's what the symbol is. In those three lines of code, the :tbody, :thead, and :element are saying you're looking for a <thead> element, a <tbody> element or any element, respectively.

@evmorov
Copy link

evmorov commented Apr 23, 2015

@daneandersen it's not the same. I've seen so many places where these elements so required (table in table or huge tables that are generates dynamically).

@AlexisKAndersen
Copy link
Collaborator

@evmorov, is there a specific set of behaviors you're looking to get? The element method will get you the element to interact with, but obvious doesn't give you any other behaviors. Are you wanting something that is indexed like a table but just for thead or tbody?

@evmorov
Copy link

evmorov commented Apr 23, 2015

@daneandersen
I think entire work with tables in PO is a big hole. Performance is horrible, no tr and th elements. I can't formulate now what we want (me and my colleagues).
Now we just use Nokogiri in PO.
I'll try to formulate problems, show problem examples and write API that I would like to see in PO (I don't think that I'm ready to make so big pull request to PO).

@AlexisKAndersen
Copy link
Collaborator

I appreciate the help. I'm definitely going to check into improving performance, and any help you can give regarding needed API that is missing is very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants