GithubHelp home page GithubHelp logo

Comments (7)

AllenFang avatar AllenFang commented on June 7, 2024

Maybe the Column format is your answer :)

from react-bootstrap-table.

kpaxqin avatar kpaxqin commented on June 7, 2024

@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>

from react-bootstrap-table.

AllenFang avatar AllenFang commented on June 7, 2024

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. :)

from react-bootstrap-table.

stephenrs avatar stephenrs commented on June 7, 2024

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.

from react-bootstrap-table.

AllenFang avatar AllenFang commented on June 7, 2024

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

from react-bootstrap-table.

stephenrs avatar stephenrs commented on June 7, 2024

Adding resizable columns would be amazing!!

from react-bootstrap-table.

AllenFang avatar AllenFang commented on June 7, 2024

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>

from react-bootstrap-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.