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

Is it possible to customize with of each column(Column width)? #24

Closed
kpaxqin opened this issue Aug 4, 2015 · 7 comments
Closed

Is it possible to customize with of each column(Column width)? #24

kpaxqin opened this issue Aug 4, 2015 · 7 comments

Comments

@kpaxqin
Copy link

kpaxqin commented Aug 4, 2015

I really need it to make the table looks better, is there any way?

@AllenFang
Copy link
Owner

Maybe the Column format is your answer :)

@kpaxqin
Copy link
Author

kpaxqin commented Aug 4, 2015

@AllenFang
The Column format can customize things in a cell, but what I mean is the width of whole column, including the .
Maybe something like:

<TableHeaderColumn dataField="id" width="25%">Product ID</TableHeaderColumn>

@AllenFang
Copy link
Owner

There's no way to customize cell currently. If you need, you can give more detail information just like your response, I will spend some time to think about that. :)

@stephenrs
Copy link

I will eventually need this feature as well, but was planning to play around in the code (or see if I can just use CSS) before I requested it :)

To clarify the request...currently by default, the component sets up tables so that each column has exactly the same width. In my project, I'll need to optimize column widths so that they show data in the most efficient way. A concrete example (not my project though):

Suppose you want to show a product listing with 2 columns: Product ID, and a descriptive product Summary. You know that the product ID is always only going to be a few characters ("P123"), but summaries could be quite long. Showing a table where each column occupies 50% of the width, just won't look very good, or convey as much information as you might like.

@AllenFang
Copy link
Owner

Hi @stephenrs , your example and explanation is very useful and maybe I need think hard for default column width or even resizing column :)

@AllenFang AllenFang changed the title Is it possible to customize with of each column? Is it possible to customize with of each column(Column width)? Aug 5, 2015
@stephenrs
Copy link

Adding resizable columns would be amazing!!

@AllenFang
Copy link
Owner

The column width feature has been added on v0.9.5, you can assign width on column as follow:

<TableHeaderColumn dataField="id" isKey={true} width="15%">Product ID</TableHeaderColumn>
<TableHeaderColumn dataField="name" width="150px">Product Name</TableHeaderColumn>

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

3 participants