Skip to content Skip to sidebar Skip to footer

How Can I Split An Attribute Value Onto Two Lines?

I have an asp.net app, and I'd like to split a line like the following on to two lines (I'd like to manually wrap the line)
<tablestyle="border:thinsolid#808080; padding: 3px 5px 7px 5px;vertical-align:top;margin-left:auto;margin-right:auto;">

You should consider using CSS files though instead of inline styling.

Solution 2:

Move the styles into a css file or style tag. Give the table a class name and reference it that way. Done.

Solution 3:

In Visual Studio Hit: Ctrl + K + D, it will auto format your markup and split the inline style to two lines.

However, i'd recommend separating the CSS out into an external style sheet or even putting it in a <style> tag within the page head.

<styletype="text/css">table { border: thin solid #808080; padding: 3px5px7px5px; vertical-align:top; margin-left: auto; margin-right: auto; }
</style>

Solution 4:

don't use inline styles. put a CSS class on it and define the styles either in a <style> block or external CSS file.

Solution 5:

Why don't you just use a style sheet, if your main concern is the length of a style?

<table class="myStyle">

..is a lot more readable than..

<table style="border: thin solid #808080; padding: 3px 5px 7px 5px; vertical-align:top; margin-left: auto; margin-right: auto;"> 

Post a Comment for "How Can I Split An Attribute Value Onto Two Lines?"