airbnb / infinity

UITableViews for the web (DEPRECATED)

Home Page:http://airbnb.io/infinity/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set the width or height of the tableview

yshuolu opened this issue · comments

I have successfully add items to a tableview ( var tableView = new infinity.ListView($el); ). However, I do not know how to set the width or height of the tableview. What is more, there is a large blank area at the bottom of the tableview. I do not know why. Thank you so much!

Hey Phineas,

From your questions, it seems like you might be a relative newcomer to Javascript. That's great! There are some very good JS documentation pages out there: I'd recommend the Mozilla Developer Network as a great resource for almost any web development topic, including Javascript development. The jQuery documentation is very useful as well, if you're using jQuery. These are references that I use almost every day. That said, the Github Issues page should be used for specific bug reports or feature requests to help move the project forward; general, broad questions like this that you can't necessarily isolate as bugs (and don't pertain to new features or use cases) are less applicable.

As noted in the documentation, explicitly setting the height of a ListView is not supported (and for infinite feeds, it's not very useful -- the height will constantly be changing as you add more elements). Although you can set the width of a ListView using standard DOM APIs or jQuery, I would instead recommend setting the width of the elements themselves using CSS.