0

I have a list using the "shaded preview" style.

I have seen a few posts about defining the width of the columns, but I'm more curious about defining the height of the column.

Let's say there is a "notes" column that may be 10 lines long. I would like to be able to set the column height to 400px, and have any remaining text in that area not show (you'd have to click the item in the list to get the full details).

Is this possible ?

1 Answer 1

0

The following CSS style for your reference, add the CSS into a script editor web part into the list view page.

<style>
.ms-rtestate-field {
    max-height: 400px;
    overflow: auto;
    width: 300px;
    word-wrap: break-word;
}
</style>

If you only want to used in the first row, we can use the CSS below.

<style>
table.ms-listviewtable>tbody>tr:first-child  .ms-rtestate-field {
    max-height: 400px;
    overflow: auto;
    width: 300px;
    word-wrap: break-word;
}
</style>
3
  • thanks, this is helpful. So when I applied the code to the script editor web part, it made each row in the list the correct height/width.. exactly how I wanted it to! What it ALSO did.. was make the entire list itself adhere to the same height/width... is there a way to get it to do only the first?
    – BKmr
    Nov 8, 2018 at 23:28
  • I modify the code in the reply, you can check it.
    – LZ_MSFT
    Nov 9, 2018 at 1:32
  • Awesome.. so now I get the following display error - basically one record (one row) has tons of text in one field (one column) that explodes the row height. This is what I wish to contain. See screenshot, and thanks for your help! link to picture of column messing up row height
    – BKmr
    Nov 14, 2018 at 20:27

Your Answer

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

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