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.

data-grid: cells are not aligned

See original GitHub issue

Describe the bug

The datagrid cells are sometimes not aligned

To reproduce

In the following example witness the Type column - rows y and ...props

<vscode-data-grid>
  <vscode-data-grid-row row-type="header">
    <vscode-data-grid-cell grid-column="1" cell-type="columnheader"> Name </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="2" cell-type="columnheader"> Type </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="3" cell-type="columnheader"> Parent </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="4" cell-type="columnheader"> Value </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="5" cell-type="columnheader">
      Description
    </vscode-data-grid-cell>
  </vscode-data-grid-row>
  <vscode-data-grid-row>
    <vscode-data-grid-cell grid-column="1">
      <a href="#">
        <code>y*</code>
      </a>
    </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="2">
      <code>number</code>
    </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="3">
      <a href="#">
        <code>CandlestickChartLineProps</code>
      </a> </vscode-data-grid-cell
    >\n<vscode-data-grid-cell grid-column="4">
      <code></code> </vscode-data-grid-cell
    >\n<vscode-data-grid-cell grid-column="5"> </vscode-data-grid-cell>
  </vscode-data-grid-row>
  <vscode-data-grid-row>
    <vscode-data-grid-cell grid-column="1">
      <code>...props</code>
    </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="2">
        <code>LineProps</code>
    </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="3"> </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="4">
      <code></code>
    </vscode-data-grid-cell>
    <vscode-data-grid-cell grid-column="5"> </vscode-data-grid-cell>
  </vscode-data-grid-row>
</vscode-data-grid>

Expected behavior

Expected all cells from the same column to be the same size

Screenshots

grab184

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
daviddossettcommented, Oct 25, 2021

Ok, thanks. I’ll try this + some other options in a sample extension environment and will get back to you if I uncover an obvious solution here. Ideally we can use auto to not prescribe column widths. I was surprised to see that break the layout above.

By the way, @worksofliam, you may want to check out this thread. I noticed some column header/cell alignment issues in your screenshot from the other day.

3reactions
atanasstercommented, Oct 25, 2021

Thank you very much, I had indeed missed that. Added your suggestion and the columns are not mis-aligned, but I hope also that the columns could be auto size at some point, here is the new layout where some of the small columns retain too much space compared to other columns with large (description) content: grab187

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataGrid column headers not aligned with data - Stack Overflow
I found that simply setting the HeadersVisiblity to "Column" does the trick - see XAML below. Easier than ...
Read more >
DataGrid cells not aligned properly #1512 - vmware/clarity
When using clr-dg-pagination and you switch to other page, data in clr-datagrid moves to the right (more, if you have many colomns and...
Read more >
DataGrid - Column headers are not aligned with cells if the ...
DataGrid - Column headers are not aligned with cells if the grid is placed inside ScrollView and showScrollbar is set to 'always'.
Read more >
Data columns not aligned with header columns when using ...
Bug reported in Blazor - DataGrid - Data columns not aligned with header columns when using Virtualized scrolling and MaskRow with hidden columns....
Read more >
React Data Grid: Aligned Grids - AG Grid
The pivot functionality does not work with aligned grids. This is because pivoting data changes the columns, which would make the aligned grids...
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