Use this in the _layouts view to prevent the annoying left twitch if the content is longed than can fit on the display. The scrollbar moved the display to the left unless you put this in the _layouts View.
/* prevent layout shifting and hide horizontal scroll */
html {
width: 100vw;
}
body {
overflow-x: hidden;
}
<style type="text/css">
tr:nth-child(odd) { background-color: #ecf1f2; padding: 4px;}
tr:nth-child(even) { background-color: #fff; padding: 4px;}
table { border-collapse: collapse; border-spacing: 0; }
</style>
If you want your table column to not wrap in ASP.Net, you can use the NoWrap property in the tag like so:
- <td nowrap="nowrap">
- content
- </td>
<td nowrap="nowrap">
content
</td>
This makes the code xhtml compliant and prevents warnings in the source view of designer in Visual Studio. Normally you could just specify a nowrap attribute by itself in plain html.
Or the CSS equivalent of setting nowrap:
- <td style="white-space:nowrap;">
- content
- </td>
<td style="white-space:nowrap;">
content
</td>
Again, using the first option will prevent warnings in source view.
This blog got it right! Note that the html css tag is important so you can add it in on its own of you already have a body tag doing it's thing.
http://fortysevenmedia.com/blog/archives/making_your_footer_stay_put_with_css/