1

I have a webpart that has a list with columns.

To change the width of these columns I inserted a Script Editor and used this code:

<style>
.ms-vh-div[displayname='Beschreibung'] {
width: 450px;
}
.ms-vh-div[displayname='Standort'] {
width: 200px;
}
.ms-vh-div[displayname='MaxAnzahlTeilnehmer'] {
width: 100px;
}
</style>

The problem ist that the width of the column "Standort" can't be reduced more. I want the content of that column to get to the next line, so that I can change the width.

See:

width

1 Answer 1

1

You could try below nth:child to apply the CSS.

My test demo:

<style type="text/css">
        table.ms-listviewtable tr th:nth-child(4) {
            display: block;
            width: 160px !important;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        table.ms-listviewtable tr td:nth-child(4) {
            display: block;
            width: 160px !important;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
    </style>

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.