question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataTable - control columns width

See original GitHub issue

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Summary

How can I control columns width? Currently I have all columns equal within the 100% width of the table, but I wan to make all columns width stick to their content (max cell content), and the last column to take the rest of the width:

image

Relevant information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zbeedatmcommented, Sep 24, 2020

Any update?

0reactions
emyarodcommented, Mar 4, 2021

as I mentioned in my previous comment, flexbox styles need to be overridden. without an updated and properly reduced test case it’s difficult to show much more but here is a proof of concept using the sandbox provided above

https://codesandbox.io/s/codesandbox-forked-mdjm9

Read more comments on GitHub >

github_iconTop Results From Across the Web

columns.width - DataTables
Column width in tables depends upon many properties such as cell borders, table borders, the border-collapse property, the content of the table and...
Read more >
How to set column widths to a jQuery datatable?
Basically i set the sScrollX to 200% then set the individual column widths to the required % that I wanted. The more columns...
Read more >
Bootstrap jquery dataTable fixed columns Width - CodePen
<div class="col-md-12"> ... id="example" class="table table-striped table-bordered nowrap" cellspacing="0" width="100%"> ... b.williamson@datatables.net.
Read more >
DataTables autoWidth Option - GeeksforGeeks
The autoWidth option is used to specify whether the automatic calculation of the column width in the DataTable is enabled or not.
Read more >
FixedColumns example - Fluid column width
First name Last name Position Office Age Start date Salary Airi Satou Accountant Tokyo 33 2008/11/28 $162... Angelica Ramos Chief Executive Officer (CEO) London 47...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found