I have 1 tablix in my report of 24.8cm width, i given a printout of this report, but in printout my tablix width converted into 23.8cm.
pls tell me why this is happening?
This might have something to do with your PageSize and the Margins. It's even possible that the table's border-width are causing it to be only just too wide to fit.
If there is not enough horizontal space on the page to place the entire table, the table will shrink in width.
Max Table's width = Page's width - (Margin-Left + Margin-Right)
So I suggest you try one of the following:
Reduce the size of the Left- or Right-Margin property.
Increase the Width of the PageSize property.
Related
Is there any difference between declaring both width and max-width and declaring only one?
As I have understood, using only the max-width property causes all of an element's content to be fit dynamically when the viewport is resized.
Consider the following pen, feel free to resize the window to see what happens:https://codepen.io/harrison-rood/pen/KKzPQMW
The first example is an image with an explicit width of 800px.
The second is an image with a max-width of 800px, but a width of 100%.
See how one is responsive and the other is not? In the first example, we're telling the image it needs to be exactly 800px. In the second example, we're saying that the image should be a fluid 100%, but not any bigger than 800px, no matter what.
You can also use this idea in reverse. The third example has an image with a width of auto (as big as possible) but a max width of 100%, meaning that it will be as big as its container, but not overflow out of it.
The fourth example shows what would happen without max width. See how the image stretches way past its container because it is much larger?
Hope this clears things up! If it does, be sure to leave an upvote!
This is because screen resolutions can be different sizes. Lets say you have an element with a width of 15%, if you increase your window width, 15% becomes larger in pixels. You can set a max-width from preventing it from going over a certain width in pixels.
Using max-width, as the name implies, means that, when a container contains more content than it can fit, its width won't exceed the specified max-width.
max-width is specifically used to prevent a container's width from increasing when it contains more content than it can fit—instead, when max-width is specified, the content will overflow out of the container.
Is it possible to use
table-layout: fixed;
width: 100%;
On a table, yet have the columns auto size to best fit the content as a table would if not set to fixed?
The table needs to be set to fixed so it does not increase in width greater than it's parent.
Or, put differently:
Is it possible to use table-layout:auto but set a max width which will be adhered to even if a long string with no spaces is held in the table.
No, you cannot combine the two different table layout modes. In automatic layout (table-layout: auto, the default), the column widths are selected by the browser so that are big enough for all content in the cells; any width settings you make will be taken just as minimum widths that may make the column wider than they would otherwise be. This also means that any width setting for the table will be exceeded when necessary for the purpose. In fixed layout (table-layout: fixed), cell content is not taken into account at all. Specified widths will be used or, in the absence of width settings, the total width is divided evenly to the columns.
The conclusion is that when you want automatic layout, or “best fit”, but do not want to exceed some given limit, you need to make sure that the sum of column width requirements does not exceed it. For example, if you have a long string with no spaces, consider inserting optional line breaks at suitable places e.g. with or <wbr>, if the content permits breaks.
You may also consider setting a maximum width for the content of a cell. This cannot be set directly (in automatic layout), but can be done by using <td><div>…</div></td> and setting the constraint on the div. If there is e.g. a long indivisible string in the content, the content will overflow by default, but the table cell will still have width determined by the width constraint.
Open this page : http://jsfiddle.net/dwDZx/6/
Resize until red
Continue make the browser smaller
<div id="container">
<div id="div1"><div class="content">one</div></div>
<div id="div2"><div class="content">two</div></div>
Why does div2 jump down a row instead of resizing? How can I solve this?
You are adding margins for the smaller screen size. Set the margins to a percentage and subtract the percentage of the width for the smaller screen size.
So do not set a margin in pixels. but in percentages.
Updated your code at //jsfiddle.net/dwDZx/9/
When the divs are red, there are two relevant constraints that the divs try to follow: width: 48% and margin-right: 10px. If the div is jumping down a row instead of resizing, that means there isn’t enough space for both of them on that row – they are trying to take up more space than is available. Thus, the second div makes a new row for itself so both divs can be as wide as they want. So let’s look at the numbers and see why the divs are asking for too much space.
Load http://jsfiddle.net/roryokane/kZZCh/, which dynamically displays the width of the page and each div, and make the Result panel exactly 400px wide, so the bug shows itself. Now the two divs are 192px wide. That makes sense – 48% of 400px is 192px. The width does not include the margin, which is 10px for each div. So the total width the divs are asking for is (192+10)*2 = (202)*2 = 404 pixels, which is more than the 400px allotted to them. No wonder the divs are wrapping instead of staying on the same row.
So how do you solve this? Dany’s answer suggests changing the margin-right value from a pixel value to a percent value. But that is only one possible solution. Finding the best solution depends on why you chose the two specific numbers in width: 48% and margin-right: 10px, and which number is more important to keep. If you need the width to remain at 48%, consider whether you want to keep a fixed margin width or switch to a flexible margin width. If you you still want a fixed width, use margin-right: 8px. If you want a flexible width, use margin-right: 2% (Dany’s solution). On the other hand, if you need the right margin width to remain at 10px, then for the width, use width: 47.5%. All of these values ensure that even when the page is only 400px wide, the divs stay on the same row.
I have created a report which contains a tablix. I observed that when the
tablix contains a certain amount of rows, a blank page is added after the page with the tablix with only the header and footer of my report.This happens both in design and print view, even if the tablix has only about 10 rows and there is a lot of space till the end of the report body (which has a height of 27cm).
I have not added any kind of page break. Has somebody perhaps had this issue?
set the ConsumeContainerWhiteSpace property for the tablix to true.
If that doesn't work.
check that the (Body Height + Header height + Footer Height) = report page size height
(body width = header width = footer width = report page size width)
It seems a good idea to set the width of the body a little less than page width - (left + right margin).
In my last report, page width was 21 cm with both left and right margin = 0.5 cm. With a body width of 20 cm and ConsumeContainerWhiteSpace=true, I still got a second page in print layout, but not with a body width of 19.9 cm.
I have a page with several arbitrarily-sized blocks of content. Is there a way I can:
Allow these blocks to resize larger or smaller to fill all available space as the window size changes,
Specify a minimum size for each of these blocks,
Hide the block completely when it will not fit on the page at the specified minimum size.
I have full control over the HTML and CSS. I would strongly prefer a solution without Javascript.
#dark; may be you want a fluid website. So,
1) give width in percentage instead of px to the div for re size larger & smaller.
check more http://www.smashingmagazine.com/2009/06/09/smart-fixes-for-fluid-layouts/
http://www.alistapart.com/articles/fluidgrids/
2) yes you can define min-width for your block like
.block{
min-width:20%;
}
3) For hiding a block or change in design with certain window size you have to define min-width or max-width in media query.
check the link
http://www.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/
http://www.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/
http://nathanstaines.com/demo/media-queries.html
http://css-tricks.com/css-media-queries/
For the 1st, you can set width and height with a % value. This will cause the "blocks" to resize as the "window size changes". For the 2nd, you can set the min-width and min-height, so that whatever the size of the window, the blocks will not shrink smaller then your specified values. As for the 3rd, you will have to use javascript.