title: Error while paginating html in UIWebView using css Multicolumns
body: <p>Here is my Problem:</p>
  
  <p>I'm currently writing an ebook reader in objective-c and want to use multicolumns to paginate my xhtml file in my webview.
  Unfortunately when I add Multicolumns to my css, my html seems to be only 2 "pages" long, which is exactly the first two <p> tags.
  Does anyone know what I'm doing wrong?.</p>
  
  <p>here is the code with which i inject the new settings into my css:</p>
  
  <pre><code>NSString *varMySheet = @"var mySheet = document.styleSheets[0];";
  
  NSString *addCSSRule =  @""
      "function addCSSRule(selector, newRule) {"
          "if (mySheet.addRule) {"
              "mySheet.addRule(selector, newRule);"       // For Internet Explorer
          "} else {"              
              "ruleIndex = mySheet.cssRules.length;"
              "mySheet.insertRule(selector + '{' + newRule + ';}', ruleIndex);"   // For Firefox, Chrome, etc.
          "}" // endif mySheet.addRule
      "}"; // end addCSSRule()    
  NSString *insertColumns = [NSString stringWithFormat:@"addCSSRule('div', 'height: 370px; -webkit-column-width: 320px');"];
  
  
  
  [wv_reader stringByEvaluatingJavaScriptFromString:varMySheet];
  
  [wv_reader stringByEvaluatingJavaScriptFromString:addCSSRule];
  
  [wv_reader stringByEvaluatingJavaScriptFromString:insertColumns];
  </code></pre>
  
  <p>For scrolling i use the following code:</p>
  
  <pre><code>int i_scrollTo = ([AppState sharedInstance].i_myselectedPage -1) * wv_reader.frame.size.height;
  [wv_reader stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.scrollTo(0,%d);", i_scrollTo]];
  </code></pre>
  
  <p>which works perfect if i don't set Multicolumns in my css.</p>
  
  <p>I also tested, if my html is somehow cut off after adding multicolumns, but a NSLog of the content of the webview showed, that the whole ebook is loaded.
  When getting the maximum scrollheight though i found out, that without columns it is <strong>79061</strong>, and after inserting columns into my css it is reduced to <strong>424</strong> for some reason i don't know.</p>
  
  <p>Can somebody please help me to fix this? I'm working on this problem for about a week now and couldn't find a solution.</p>
  
  <p>Thx in advance.
  Maverick</p>
  
  <p><em><strong></em>*UPDATE*<em>*</em></strong>
  Scrolling horizontally doesn't work either, because my document.scrollWidth is stuck to the width of my Columns, which is pretty odd I think.</p>