SharePoint List Form Body Formatting

SharePoint list forms are a powerful tool for collecting and managing data within your organization. While they offer a wide range of customization options, formatting the body of a SharePoint list form can sometimes be a challenge. In this guide, we'll delve into the intricacies of SharePoint list form body formatting, helping you create visually appealing and user-friendly forms.

Customizing SharePoint List Forms in InfoPath 2010
Customizing SharePoint List Forms in InfoPath 2010

SharePoint list forms are a powerful tool for collecting and managing data within your organization. While they offer a wide range of customization options, formatting the body of a SharePoint list form can sometimes be a challenge. In this guide, we'll delve into the intricacies of SharePoint list form body formatting, helping you create visually appealing and user-friendly forms.

Editing a Form: InfoPath
Editing a Form: InfoPath

Understanding SharePoint List Form Body

Before we dive into formatting, it's crucial to understand the structure of a SharePoint list form body. The body is essentially a container for various web parts, such as text fields, dropdown menus, and calculated fields. Each web part is enclosed within a <div> tag, and the entire body is wrapped in a <div id="bodyCell"> tag.

Database Programming - MS Access Programmers
Database Programming - MS Access Programmers

The body's structure is defined by the form's schema, which is an XML file that outlines the layout and behavior of the form. Understanding this structure is key to effectively formatting the form body.

Default Formatting and Styling

Client Challenge
Client Challenge

By default, SharePoint applies a basic style to the form body, including fonts, colors, and spacing. However, these styles can be overridden or augmented to better match your organization's branding or to improve the user experience.

SharePoint uses CSS (Cascading Style Sheets) for styling. You can modify the default styles or create new ones using SharePoint's built-in CSS editor or by directly editing the form's CSS files.

Formatting with CSS

Booking Form Builder | SaaS Admin Dashboard UIUX by Be Confidency on Muzli
Booking Form Builder | SaaS Admin Dashboard UIUX by Be Confidency on Muzli

CSS is the primary tool for formatting the body of a SharePoint list form. You can use CSS to change the font size, color, and style, add background images or colors, and much more. Here's a simple example of how you might change the font color of the form body:

<style>
    #bodyCell {
        color: #333333;
    }
</style>

In this example, the CSS selector <#bodyCell> targets the main container of the form body, and the property <color> changes the text color to a dark gray.

Advanced Formatting Techniques

Client Form Template Layout
Client Form Template Layout

While CSS provides a wealth of formatting options, there are some advanced techniques you can use to take your SharePoint list forms to the next level.

SharePoint allows you to use JavaScript to add interactivity to your forms. For example, you might use JavaScript to show or hide fields based on user input, or to validate form data before submission.

Customize SharePoint Forms with JSON
Customize SharePoint Forms with JSON
Free Informed Consent Form (B&W)
Free Informed Consent Form (B&W)
ISO9001 2015 Purchasing Procedure Template Word
ISO9001 2015 Purchasing Procedure Template Word
Digital Product Handover Form
Digital Product Handover Form
Body Chart
Body Chart
the printable form for an employee's work schedule is shown in this file
the printable form for an employee's work schedule is shown in this file
the front and back side of a computer screen showing an image of a person's body
the front and back side of a computer screen showing an image of a person's body
body check sheet Daily Body Check Form, Home Health Assessment Form, Body Check Form, Body Charts, Body Check Free Printable Skin Assessment Forms, Free Body Check Form, Medical Patient Assessment Form, Body Scan Sheet, Printable Home Health Assessment Form
body check sheet Daily Body Check Form, Home Health Assessment Form, Body Check Form, Body Charts, Body Check Free Printable Skin Assessment Forms, Free Body Check Form, Medical Patient Assessment Form, Body Scan Sheet, Printable Home Health Assessment Form
Service Request Form
Service Request Form
Free editable printable document templates | Canva
Free editable printable document templates | Canva
an image of a computer screen with the name and number of each item on it
an image of a computer screen with the name and number of each item on it
a blue sheet with the words personal information sheet
a blue sheet with the words personal information sheet
Nonconformance Template Bundle | Investigation Form, Risk Assessment, Action Tracker Dashboard, Quality Forms
Nonconformance Template Bundle | Investigation Form, Risk Assessment, Action Tracker Dashboard, Quality Forms
a form of employment forms for employees to use in the company's workday
a form of employment forms for employees to use in the company's workday
Blue White Minimalist Performance Appraisal Form A4 Document
Blue White Minimalist Performance Appraisal Form A4 Document
13 Blank SBAR Templates (Word, PDF) ᐅ TemplateLab
13 Blank SBAR Templates (Word, PDF) ᐅ TemplateLab
FREE 8+ Sample Fitness Assessment Forms in PDF | MS Word
FREE 8+ Sample Fitness Assessment Forms in PDF | MS Word
TalentScale — Employee Work Information Form
TalentScale — Employee Work Information Form
Community Services Client Feedback Form Template
Community Services Client Feedback Form Template
Professional Client Intake Form
Professional Client Intake Form

Using JavaScript for Dynamic Formatting

JavaScript can be used to add dynamic formatting to your SharePoint list forms. For instance, you might use JavaScript to change the background color of a field based on the value entered by the user. Here's a simple example:

<script>
    function changeBackgroundColor() {
        var status = document.getElementById("Status").value;
        if (status == "Active") {
            document.getElementById("bodyCell").style.backgroundColor = "#D1FAE5";
        } else if (status == "Inactive") {
            document.getElementById("bodyCell").style.backgroundColor = "#F8D7DA";
        }
    }
</script>

In this example, the JavaScript function <changeBackgroundColor> changes the background color of the form body based on the value of the "Status" field.

Responsive Design for Mobile Devices

With the increasing use of mobile devices, it's crucial to ensure that your SharePoint list forms are responsive and display well on all screen sizes. SharePoint provides tools for creating responsive forms, including the ability to use media queries to apply different styles based on the size of the user's screen.

To create a responsive form, you can use the <style> tag with media queries to apply different styles based on the screen size. For example:

<style>
    @media screen and (max-width: 640px) {
        #bodyCell {
            font-size: 14px;
        }
    }
</style>

In this example, the media query <@media screen and (max-width: 640px)> applies a smaller font size to the form body when the screen width is 640 pixels or less.

In conclusion, SharePoint list form body formatting is a powerful tool for creating engaging and user-friendly forms. Whether you're using basic CSS styles or advanced JavaScript techniques, there's a wealth of opportunities to customize your forms and enhance the user experience. So go ahead, explore the possibilities, and make your SharePoint list forms truly your own.