Topic: How can I change datatable width for one column only?

cwalladev premium asked 2 years ago


I have 5 columns and need to change a single column's width. What is the best way to do this?

https://i.imgur.com/DgUxf7I.png


Mateusz Lazaru staff answered 2 years ago


hi,

just like @Alban B. said, you can use column's width option, example:

{ label: 'Position', field: 'position', sort: false, width: 350 },

snippet: https://mdbootstrap.com/snippets/standard/mlazaru/4073027#html-tab-view


Alban B. priority answered 2 years ago


I think I can try and give you a generic answer (not having an actual code snippet) before the mods might give you a more structured one.

This is a basic column obj with a fixed position on the left, cell background and fixed width.

columns: [
  {
    label: "Item",
    field: "col1",
    accessor: "col1",
    fixed: "left",
    bgColor: "black",
    width: "200px",
  }, 

.....



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.2
  • Device: MacBook Air M1
  • Browser: Chrome
  • OS: macOS 12.4
  • Provided sample code: No
  • Provided link: Yes