biegehydra / EasyCsv-Dotnet

EasyCsv is a simple and efficient .NET library for handling CSV files in your projects. With a **fluent** user-friendly API, it allows you to easily read, write, and manipulate CSV files with a minimal amount of code.
MIT License
25 stars 3 forks source link

CsvTableHeaderMatcher custom styles #4

Closed akriger closed 1 month ago

akriger commented 2 months ago

Is there a way to provide custom styles to the CsvTableHeaderMatcher? When there is a long string of text provided for a column, the Preview Information is to wide and makes the Csv Headers to small to read what they are matched to.

image

biegehydra commented 2 months ago

In this commit, which is live in version 2.0.0-beta8.2, I changed the default css to give the Default Value column and Csv Headers column a width of arround 220px. I also added this css to the preview information container.

  .preview-information-container {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3; /* Number of lines before truncation */
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

The end result is something like this. If you would like to further configure the css, every Td and Th now has a unique css class that you can configure, e.g. ".preview-information-th" and ".preview-information-td" Screenshot_2

I reckon you might want an additional restriction on the width of the preview information th. Maybe something like:

.preview-information-th {
        max-width: 300px;
}