Monday, October 27, 2014

How to display SharePoint view column vertically?

Hi,


We can use jQuery and CSS to achieve your requirement, please add the following code into a content editor web part.



<script src="http://ift.tt/1gvOTdo; type="text/javascript"></script>
<script type="text/javascript">
$(function () {
//add the column name into the "columns" array.
var columns = ["Title","Choice","Single line of text"];
$(".ms-listviewtable tr th").each(function (i) {
for(var j=0;j<columns.length;j++){
if ($(this).find("a").text() == columns[j]) {
$(this).find("a").addClass("ColumnRotate");
}
}

});
});
</script>
<style>
.ColumnRotate{
width: 22px;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
line-height: 240px;
display: block;
}
</style>



Best Regards




Dennis Guo

TechNet Community Support



No comments:

Post a Comment