Carousel codes correction

I have used 'autoplay' carousel from site:

http://kenwheeler.github.io/slick/

and i want that set width of place that shows the slides,please let me know that how can set it?

thanks
MOSTAGHASSIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
Can you describe what you want to do in more detail?  Screenshots with annotations work well...
0
MOSTAGHASSIAuthor Commented:
Yes,in each kind of carousel that you select(i have selected autoplay) there is a place that slides move inside it and it is around 500px ,but i want that change this to e.g 1000px and i cannot.
0
Steve BinkCommented:
What are you doing to set the width?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

MOSTAGHASSIAuthor Commented:
Because my codes retrieve the data from mysql and i have these codes then i must say that i use 'table' instead of 'div'  for changing the width i change the width of table as below:

      <table width="950" height="90" border="0" align="center" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF" class="autoplay" style=" border:1px solid #ffffff">
        <tr class="autoplay">
         <td >//my codes</td>
         </tr>
          </table/

Open in new window


so it works good but  width="950" does not work and the place of slider remain Constance around 500.
0
Steve BinkCommented:
Why would you use a table?  Use a div element with proper CSS targeting.
0
MOSTAGHASSIAuthor Commented:
Ok,suppose we use div how can apply our css to these codes:

		<div class="slider autoplay">
					<div><h3>1</h3></div>
					<div><h3>2</h3></div>
					<div><h3>3</h3></div>
					<div><h3>4</h3></div>
					<div><h3>5</h3></div>
					<div><h3>6</h3></div>
				</div>
			<pre><code class="language-javascript">
$('.autoplay').slick({
  slidesToShow: 3,
  slidesToScroll: 1,
  autoplay: true,
  autoplaySpeed: 2000,
});
				</code></pre>

Open in new window

0
Steve BinkCommented:
You can target ".slider", but I would rather see an id attribute provided.  For example:
<style>
  #mySlider {
     width: 1000px;
   }
</style>
<div id="mySlider" class="slider autoplay">
    <div><h3>1</h3></div>
    <div><h3>2</h3></div>
    <div><h3>3</h3></div>
    <div><h3>4</h3></div>
</div>
<script>$('.autoplay').slick({ autoplay:true; autoplaySpeed:2000; });</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MOSTAGHASSIAuthor Commented:
Thanks,but why it does not work for table?
0
Steve BinkCommented:
Because tables work differently.  You can provide a table with a width and height, but it will resize in an attempt to make its content fit.  

Generally speaking, use tables only for tabular data, such as statistics or spreadsheet displays.  Do not use it as a base structural element.
0
MOSTAGHASSIAuthor Commented:
Thanks Steve, i changed it to div and it works very well.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.