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.

Feature request: Ability to remove table borders completely

See original GitHub issue

I’m trying to convert some tables that I rendered in my app through convoluted HTML into the new DataTables, but in order to reproduce the format I need to get rid of some of the table borders and that doesn’t seem possible right now. I have used style_as_list_view but that doesn’t help me with the horizontal borders. Basically, I’m trying to style my table like this:

image

Just as there is the style_as_list_view flag, could there be one called something like style_without_borders so that we can then add borders as needed through normal cell styling?

If this is acceptable and with some guidance, I’m happy to submit a PR for this.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
oriolmirosacommented, Nov 7, 2018

Sure! Here’s what I did (they key element to get rid of the borders is the boxShadow: '0 0' in the style_cell:

dash_table.DataTable(
    columns=[{"name": i, "id": i} for i in dataframe.columns],
    data=dataframe.to_dict("rows"),
    style_cell={'fontFamily': 'sans-serif', 'fontSize': '12px', 'boxShadow': '0 0'},
    style_cell_conditional=[{
        'if': {'row_index': 'even'},
        'backgroundColor': '#F5F5F5'
    }] + [{
        'if': {'column_id': col},
        'fontWeight': 'bold'
    } for col in df_index_names],
    style_header={
        'backgroundColor': 'white',
        'fontWeight': 'bold',
        'borderBottom': '1px solid black'
    }
)

And the result, which can be compared with the table I started with (not using DataTable shown above):

image

2reactions
innominate227commented, Jun 26, 2019

In dash 1.0.0 you now need to use style_data={ 'border': '0px' }, to remove the borders

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove table borders in Google Docs - Zapier
With your Google Doc open, highlight the table cells that you'd like to make borderless. · Select Format > Table > Table properties....
Read more >
PowerPoint 2016 completely ignores table border requests.
table to format in PowerPoint. I want a simple table, with every other row having a slightly gray background and a box border...
Read more >
css - How to completely remove borders from HTML table
For me I needed to do something like this to completely remove the borders from the table and all cells. This does not...
Read more >
Make table border setting override cell styles - Adobe InDesign
I originally posted a long message as to why this is needed and upvoted the feature request. Then, I realized this feature ...
Read more >
Ability to Hide Table lines/borders/gridlines for Confluence
However, in cases where the same needs to use a table without gridlines, there is no option to hide it. This is a...
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